I have been reading this paper and it is mentioned there that the Applicative
class is closed under composition.
What does that actually mean ?
In general, "X is closed under Y" means that if you take some Xs and Y them, the result is an X. For example, "the set of integers is closed under addition" means that if you take two integers and add them, the result is an integer.
Therefore, saying that the class Applicative
is closed under composition means that if you take two applicative functors and compose them, the result is also an applicative functor.
The composition of Applicative
s f
and g
is
newtype Compose f g a = Compose { getCompose :: f (g a) }
and "Applicative
is closed under composition" means that this newtype
itself has an Applicative
instance.
http://hackage.haskell.org/package/transformers-0.3.0.0/docs/Data-Functor-Compose.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With