Copyright | Conor McBride and Ross Paterson 2005 |
---|---|
License | BSD-style (see the LICENSE file in the distribution) |
Maintainer | libraries@haskell.org |
Stability | stable |
Portability | portable |
Safe Haskell | Safe |
Language | Haskell2010 |
Documentation
newtype Const a (b :: k) Source #
The Const
functor.
Examples
>>>
fmap (++ "World") (Const "Hello")
Const "Hello"
Because we ignore the second type parameter to Const
,
the Applicative instance, which has
essentially turns into (<*>)
:: Monoid m => Const m (a -> b) -> Const m a -> Const m bMonoid m => m -> m -> m
, which is (<>)
>>>
Const [1, 2, 3] <*> Const [4, 5, 6]
Const [1,2,3,4,5,6]