Where we see a type parameter to the right of a function arrow (or with no arrow at all, since a
is isomorphic to () -> a
), we have a covariant functor (or simply, "functor").
newtype Decode k v a = Decode{ decode :: Map k v -> a }
Covariant functors quite often admit an applicative aspect that allows us to build up larger stuff within the type parameter.
…
Keep reading with a 7-day free trial
Subscribe to Type Classes to keep reading this post and get 7 days of free access to the full post archives.