
Hi Clinton,
Sorry for late reply, but just for the sake of completeness the
compdata package defines just the functor you mentioned
http://hackage.haskell.org/package/compdata-0.11/docs/Data-Comp-Multi-HFunct....
Regards,
Sergey
On Tue, Jul 11, 2017 at 9:18 AM, Clinton Mead
Hi All
Thanks for all your help.
I've actually picked up Mario's rank2classes package as it seems like I need a little but more power than Functors, as I want things like `liftA2` for example.
I've pushed across a very simple pull request to you Mario that simply adds "PolyKinds" to your list of language extensions. This automatically this generalises the kinds your Functor and Apply accept (and perhaps others) as I'm quantifying not over * but over a data kind type. No other changes are needed.
Clinton
On Sat, Jul 8, 2017 at 5:57 AM, Mario Blažević
wrote: On 2017-07-07 12:48 AM, Clinton Mead wrote:
Consider the illustrative code below: ... class MyFunctor f where myFmap :: (forall a. t a -> u a) -> f t -> f u ...
Basically this is a sort of "higher order" functor, but I can't seem to fit it into an ordinary functor.
But it seems like I'm reinventing the wheel, as my code is suspiciously like `Functor` but only slightly different.
Has this sort of class already been created and if so what package is it in?
Yes, I have recently created rank2classes package:
http://hackage.haskell.org/package/rank2classes
Apart from the mirror-universe Functor class, the package exports the Applicative, Foldable, Traversable, Applicative, and Distributive classes, as well as some Template Hashell to derive some of their instances automatically.
_______________________________________________ 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.
_______________________________________________ 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.