[Haskell-cafe] Is this a "monad" for contravariant functors?

MigMit migmit at gmail.com
Fri Mar 10 22:37:37 UTC 2017


Answered it here: http://stackoverflow.com/questions/30641500/are-there-contravariant-monads/30642831#30642831

> On 10 Mar 2017, at 23:25, Zemyla <zemyla at gmail.com> wrote:
> 
> There originally seems like there shouldn't be one, because it's impossible to, for any permutation of the arguments of (>>=), get the covariances/contravariances right on the arguments. However, based on the fact that there is a mapping:
> 
> a -> ((a -> r) -> r)
> 
> and what seems like an isomorphism:
> 
> (a -> r) -> (((a -> r) -> r) -> r)
> (((a -> r) -> r) -> r) -> (a -> r)
> 
> then this looks like it might be some kind of monad-like structure:
> 
> class Contravariant f => Contramonad f where
>     contrareturn :: a -> f (f a)
>     contrabind :: (a -> f (f b)) -> f b -> f a
> 
> I have no idea what the laws should be for it, though. So is this worth pursuing, or have I just stumbled down a blind alley?
> _______________________________________________
> Haskell-Cafe mailing list
> To (un)subscribe, modify options or view archives go to:
> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
> Only members subscribed via the mailman list are allowed to post.



More information about the Haskell-Cafe mailing list