Skip to main content

Functor

· One min read

Represents a mapping between categories

Functions​

class Functor f where
fmap :: (a -> b) -> f a -> f b
(<$) :: a -> f b -> f a

Operators​

  • <$> - infix form of fmap

Laws​

fmap id = id
fmap (f . g) = fmap f . fmap g