-
-
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
TFunctor for monad transformers #1812
Comments
This is the class called Hoist in scalaz (but with Monad requirement on F). There is also Cohoist with ~the same signature (but asking for Comonad in F). I think Hoist is the class corresponding with abstraction underlying mapk functions from all cats transformers (hence the Monad requirement from scalaz typeclass).
Here Hoist is an endofunctor in the nat-trans category |
Shouldn't this be |
There is also the cats-tagless direction of higher-kind traits. Both up their kindness towards different shapes. In comparison, along with their semigroupal class (cats-tagless FunctorK versus functork candidate named Hoist):
FunctorK may be anyone of the above, depending on the frequency of use or maybe finding better anchoring in cat-theory.. |
In my experience, the cats-tagless encoding have proved more useful because the Hoist functor has to be constrained in the M[] parameter to be truly useful. And in this encoding that is a constraint you cannot put, M[] parameter being inside the trait.
... downgrading it from a Functor in the
... and derived traits (Semigroupal.Monoidal | Inv/Con/Cov-ariant combinations, (co)-monadic, ..) gives you the possibility to combine algebras for specific combinations of F and G in which you can freely choose their power in the definition of F ~> G. And also, exemplified above, contravariance traits, just like the covariant ones are both derived from SemigroupalK being duals to each other in beautiful simetry, as in the lower-kinded cats counterparts. As opposed to the scalaz Hoist-Cohoist pair which separate from the start two traits for contravariant and covariant transformers, each limited to a subcategory of the nat-trans (for Hoist: F:Monad ~> G, for Cohoist: F: Comonad ~> G). |
I think this discussion is super interesting, I wonder if maybe we should move the |
Sorry for the accidental close |
As a continuation of #1713 and #1492. I am working on a PR
The text was updated successfully, but these errors were encountered: