[Haskell-cafe] Higher order functor package?

Clinton Mead clintonmead at gmail.com
Tue Jul 11 06:18:11 UTC 2017


Hi All

Thanks for all your help.

I've actually picked up Mario's rank2classes package
<http://hackage.haskell.org/package/rank2classes> 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ć <mblazevic at stilo.com> 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.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20170711/d011a0bd/attachment.html>


More information about the Haskell-Cafe mailing list