Apologies

Gabriel Gonzalez gabriel439 at gmail.com
Tue May 21 08:24:43 CEST 2013


On 05/20/2013 10:41 PM, Carter Schonwald wrote:
> could you elaborate on the other useful generalizations please? :-)
>
Sorry, I made yet another mistake.  The implementation and type should be:

mapM :: (a -> m b) -> ListT m a -> ListT m b
mapM f m = m >>= lift . f

That will not leak and is almost always what people actually want when 
they use `mapM`, whether or not they use `pipes` to implement `ListT`.  
It also obeys a different set of functor laws:

mapM return = id
mapM (f >=> g) = mapM f . mapM g

Anyways, sorry for the spam.  This is just to show that there are many 
ways you can generalize something and `Foldable`/`Traversable` are not 
the last word.
>
> On Tue, May 21, 2013 at 1:41 AM, Gabriel Gonzalez 
> <gabriel439 at gmail.com <mailto:gabriel439 at gmail.com>> wrote:
>
>     I want to apologize to wren (and everybody else).  I was tired and
>     overreacted when the discussion started veering into making more
>     breaking changes.
>
>     I don't mind the Foldable changes too much.  My main concerns are:
>
>     * loss of monomorphism makes teaching more difficult
>     * They can be generalized in other useful ways
>
>     However, I don't consider those concerns show-stoppers.
>
>     _______________________________________________
>     Libraries mailing list
>     Libraries at haskell.org <mailto:Libraries at haskell.org>
>     http://www.haskell.org/mailman/listinfo/libraries
>
>


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/libraries/attachments/20130520/7b734d34/attachment.htm>


More information about the Libraries mailing list