Welcome to the Functional Programming Zulip Chat Archive. You can join the chat here.
The docs for Control.Invertible.Monoidal say
Invariant monoidal functor. This roughly corresponds to Applicative, [..]
What's rough about the correspondence, if anything?
I think what they're referring to is that the module's contents roughly correspond to the contents of Control.Applicative
Oh wait there's two places they talk about correspondence, whoops! Reading that part now
So you could define Applicative in terms of Monoidal I'm pretty sure.
You should try give it a go defining pure and <*> in terms of unit and >*<
pure
<*>
unit
>*<
I think they are actually exactly equivalent, not only "roughly correspondent", but the Applicative interface is nicer to work with, in practice.
Applicative
It's basically the same thing as relation between
bind :: Monad m => m a -> (a -> m b) -> m b
and
join :: Monad m => m (m a) -> m a
One is more convenient, the other is closer to formal definition
The docs for Control.Invertible.Monoidal say
What's rough about the correspondence, if anything?
I think what they're referring to is that the module's contents roughly correspond to the contents of Control.Applicative
Oh wait there's two places they talk about correspondence, whoops! Reading that part now
So you could define Applicative in terms of Monoidal I'm pretty sure.
You should try give it a go defining
pure
and<*>
in terms ofunit
and>*<
I think they are actually exactly equivalent, not only "roughly correspondent", but the
Applicative
interface is nicer to work with, in practice.It's basically the same thing as relation between
and
One is more convenient, the other is closer to formal definition