-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Apply, Applicative, Monad for contravariant functor? #2324
Comments
@drbild The contravariant counterpart of A covariant functor carries the intuition of being like a function that produces a type of outputs. |
We already have these type classes, they're named |
It seems this was already done, or suggested, in #1935 |
@diesalbla Thanks for the link. I also posted this on SO. The answer there suggested that I am still confused though because |
|
Right. So I guess I just need to read through the Haskell docs for In sum, contravariant versions of |
Here is a discussion about the subject: https://twitter.com/mpilquist/status/431122935081078784 |
Yup Contravariant Monad doesn't really make sense. If you think about a contraFlatMap: def contraFlatMap(fa: F[A])(f: F[B] => A): F[B] You realize that implementing something like this is practically impossible for almost all types. |
I have the following trait...
I am learning FP and would like to explore definitions of
Apply
,Applicative
, and possibly evenMonad
instances for this trait but all of these type classes are extensions ofFunctor
. Do versions of these type classes exist in Cats for contravariant functors? If these type classes have not yet been implemented, I would be happy to contribute them!The text was updated successfully, but these errors were encountered: