Haskell - Functors in GHCi
Running :i Functor
in ghci yields the following:
class Functor (f :: * -> *) where
fmap :: (a -> b) -> f a -> f b
(<$) :: a -> f b -> f a
Plus it lists available instances of the Functor typeclass:
instance Functor (Either a) -- Defined in ‘Data.Either’
instance Functor [] -- Defined in ‘GHC.Base’
instance Functor Maybe -- Defined in ‘GHC.Base’
instance Functor IO -- Defined in ‘GHC.Base’
instance Functor ((->) r) -- Defined in ‘GHC.Base’
instance Functor ((,) a) -- Defined in ‘GHC.Base’
More information on functors: http://notes.maciejsmolinski.com/2018/02/16/functors-by-example/
Written by Maciej Smoliński
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Haskell
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#