Hoogle Search
Within LTS Haskell 24.6 (ghc-9.10.2)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
(
<$ ) :: Functor f => a -> f b -> f aghc GHC.Prelude.Basic No documentation available.
(
<$> ) :: Functor f => (a -> b) -> f a -> f bghc GHC.Prelude.Basic No documentation available.
(
<$> ) :: Functor f => (a -> b) -> f a -> f bghc GHC.Utils.Monad No documentation available.
(
<$> ) :: Functor f => (a -> b) -> f a -> f bhaskell-gi-base Data.GI.Base.ShortPrelude An infix synonym for fmap. The name of this operator is an allusion to $. Note the similarities between their types:
($) :: (a -> b) -> a -> b (<$>) :: Functor f => (a -> b) -> f a -> f b
Whereas $ is function application, <$> is function application lifted over a Functor.Examples
Convert from a Maybe Int to a Maybe String using show:>>> show <$> Nothing Nothing
>>> show <$> Just 3 Just "3"
Convert from an Either Int Int to an Either Int String using show:>>> show <$> Left 17 Left 17
>>> show <$> Right 17 Right "17"
Double each element of a list:>>> (*2) <$> [1,2,3] [2,4,6]
Apply even to the second element of a pair:>>> even <$> (2,2) (2,True)
-
haskell-src-meta Language.Haskell.Meta.Utils No documentation available.
-
ansi-wl-pprint Text.PrettyPrint.ANSI.Leijen No documentation available.
-
ansi-wl-pprint Text.PrettyPrint.ANSI.Leijen No documentation available.
(
<$$> ) :: Functor m => (a -> b) -> m a -> Permutation m bparsers Text.Parser.Permutation The expression f <$$> p creates a fresh permutation parser consisting of parser p. The final result of the permutation parser is the function f applied to the return value of p. The parser p is not allowed to accept empty input - use the optional combinator (<$?>) instead. If the function f takes more than one parameter, the type variable b is instantiated to a functional type which combines nicely with the adds parser p to the (<||>) combinator. This results in stylized code where a permutation parser starts with a combining function f followed by the parsers. The function f gets its parameters in the order in which the parsers are specified, but actual input can be in any order.
(
<$?> ) :: Functor m => (a -> b) -> (a, m a) -> Permutation m bparsers Text.Parser.Permutation The expression f <$?> (x,p) creates a fresh permutation parser consisting of parser p. The final result of the permutation parser is the function f applied to the return value of p. The parser p is optional - if it can not be applied, the default value x will be used instead.
(
<$ ) :: Functor f => a -> f b -> f ario RIO.Prelude Replace all locations in the input with the same value. The default definition is fmap . const, but this may be overridden with a more efficient version.
Examples
Perform a computation with Maybe and replace the result with a constant value if it is Just:>>> 'a' <$ Just 2 Just 'a' >>> 'a' <$ Nothing Nothing