[Haskell-cafe] Higher order functor package?

Mario Blažević mblazevic at stilo.com
Fri Jul 7 19:57:52 UTC 2017


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.





More information about the Haskell-Cafe mailing list