universum-1.3.0: Custom prelude used in Serokell

Safe HaskellSafe
LanguageHaskell2010

Universum.Functor.Fmap

Description

This module contains useful functions to work with Functor type class.

Synopsis

Documentation

map :: Functor f => (a -> b) -> f a -> f b Source #

map generalized to Functor.

>>> map not (Just True)
Just False
>>> map not [True,False,True,True]
[False,True,False,False]

(<<$>>) :: (Functor f, Functor g) => (a -> b) -> f (g a) -> f (g b) infixl 4 Source #

Alias for fmap . fmap. Convenient to work with two nested Functors.

>>> negate <<$>> Just [1,2,3]
Just [-1,-2,-3]