iteratee LooseMap

John Lato jwlato at gmail.com
Sun Aug 22 07:19:12 EDT 2010


Hi Antoine,

Restricting the element types is exactly what it's for.  In the case of a
StorableVector (or unboxed Vector, etc.), the instance looks like this:

    instance (Storable el, Storable el') => LooseMap StorableVector el el'
where

What difficulties have you had with multi-param typeclasses?  I haven't had
any problems with LooseMap yet.

Arguably it could be in another package, but I don't want to make a package
for just one class.

John

On Sun, Aug 22, 2010 at 5:20 AM, Antoine Latter <aslatter at gmail.com> wrote:

> Hi John,
>
> I'm going over the modules in the new iteratee branch with an eye for
> which should be public and such, and I was trying to figure out what
> benefit the LooseMap tyepclass could have over the Functor class.
>
> The big one is that I can restrict element types that the class is
> instantiated over, but since the first parameter is of kind (* -> *),
> I don't know in what context that restriction even makes sense.
>
> I'll send a patch which drops it, and if it makes sense you can apply
> it. No harm done if you have a use-case for it, though.
>
> I've had pains in the past trying to use multi-parameter typeclasses
> which have more than one free variable, so that's something to
> consider as well.
>
> Antoine
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://projects.haskell.org/pipermail/iteratee/attachments/20100822/7df930f7/attachment.htm 


More information about the Iteratee mailing list