Cont as Monoid

Stefan O'Rear stefanor at cox.net
Sun Sep 9 11:18:16 EDT 2007


On Sun, Sep 09, 2007 at 12:58:25PM +0100, Conor McBride wrote:
> My usual rule of thumb is that inherent natural monoidal structure
> should have a higher priority than just applicative lifting of
> monoidal structure from the value type. Here it's a bit harder to call
> because it's a choice of two lifts, but I'd suggest that (Cont r) has
> natural monoidal structure if r is a monoid, and hence this should
> take precedence over the applicative lifting (which is what liftM2
> does, but with too restrictive a type).
>
> I guess my fairly feeble reason for this rule of thumb is that it fits
> with what one would expect for []. It may also be to do with the way I
> read types: when I see a type application (f t), I think of it as an
> f-like thing with t-like details, hence the natural properties of f
> are somehow the more significant. Moreover, preferring the f-specific
> thing is no big deal if you have a cheap and uniform way to get the
> other thing (eg, liftA2 or idiom brackets). The f-specific thing
> usually requires special consideration, hence benefits most from
> overloading.

Okay, conversion successful.  I want your instance now. :)

Stefan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://www.haskell.org/pipermail/libraries/attachments/20070909/588b28d0/attachment.bin


More information about the Libraries mailing list