Andreas Abel | 18 May 23:21 2013
Picon

Traversable.mapM_ missing

On some haskell list I read that for lists,

   mapM_ f l

is more space-efficient that just

   void $ mapM f l

Any reason why mapM_ is missing from Data.Traversable?

Cheers,
Andreas

--

-- 
Andreas Abel  <><      Du bist der geliebte Mensch.

Theoretical Computer Science, University of Munich
Oettingenstr. 67, D-80538 Munich, GERMANY

andreas.abel <at> ifi.lmu.de
http://www2.tcs.ifi.lmu.de/~abel/
Henning Thielemann | 18 May 23:23 2013
Picon

Re: Traversable.mapM_ missing


On Sat, 18 May 2013, Andreas Abel wrote:

> On some haskell list I read that for lists,
>
>  mapM_ f l
>
> is more space-efficient that just
>
>  void $ mapM f l
>
> Any reason why mapM_ is missing from Data.Traversable?

Because it is in Data.Foldable.
Jake McArthur | 18 May 23:24 2013
Picon

Re: Traversable.mapM_ missing

It lives in Data.Foldable. You don't need the full power of Traversable for mapM_!


On Sat, May 18, 2013 at 5:21 PM, Andreas Abel <andreas.abel <at> ifi.lmu.de> wrote:
On some haskell list I read that for lists,

  mapM_ f l

is more space-efficient that just

  void $ mapM f l

Any reason why mapM_ is missing from Data.Traversable?

Cheers,
Andreas

--
Andreas Abel  <><      Du bist der geliebte Mensch.

Theoretical Computer Science, University of Munich
Oettingenstr. 67, D-80538 Munich, GERMANY

andreas.abel <at> ifi.lmu.de
http://www2.tcs.ifi.lmu.de/~abel/

_______________________________________________
Libraries mailing list
Libraries <at> haskell.org
http://www.haskell.org/mailman/listinfo/libraries

_______________________________________________
Libraries mailing list
Libraries <at> haskell.org
http://www.haskell.org/mailman/listinfo/libraries
Edward Kmett | 18 May 23:34 2013
Picon

Re: Traversable.mapM_ missing

Because it is supplied by the Foldable superclass.


On Sat, May 18, 2013 at 5:21 PM, Andreas Abel <andreas.abel <at> ifi.lmu.de> wrote:
On some haskell list I read that for lists,

  mapM_ f l

is more space-efficient that just

  void $ mapM f l

Any reason why mapM_ is missing from Data.Traversable?

Cheers,
Andreas

--
Andreas Abel  <><      Du bist der geliebte Mensch.

Theoretical Computer Science, University of Munich
Oettingenstr. 67, D-80538 Munich, GERMANY

andreas.abel <at> ifi.lmu.de
http://www2.tcs.ifi.lmu.de/~abel/

_______________________________________________
Libraries mailing list
Libraries <at> haskell.org
http://www.haskell.org/mailman/listinfo/libraries

_______________________________________________
Libraries mailing list
Libraries <at> haskell.org
http://www.haskell.org/mailman/listinfo/libraries
Andreas Abel | 19 May 01:34 2013
Picon

Re: Traversable.mapM_ missing

Thanks, Henning, Jake, and Edward, for the quick answer!

On 18.05.13 11:34 PM, Edward Kmett wrote:
> Because it is supplied by the Foldable superclass.
>
>
> On Sat, May 18, 2013 at 5:21 PM, Andreas Abel <andreas.abel <at> ifi.lmu.de
> <mailto:andreas.abel <at> ifi.lmu.de>> wrote:
>
>     On some haskell list I read that for lists,
>
>        mapM_ f l
>
>     is more space-efficient that just
>
>        void $ mapM f l
>
>     Any reason why mapM_ is missing from Data.Traversable?
>
>     Cheers,
>     Andreas
>
>     --
>     Andreas Abel  <><      Du bist der geliebte Mensch.
>
>     Theoretical Computer Science, University of Munich
>     Oettingenstr. 67, D-80538 Munich, GERMANY
>
>     andreas.abel <at> ifi.lmu.de <mailto:andreas.abel <at> ifi.lmu.de>
>     http://www2.tcs.ifi.lmu.de/~__abel/ <http://www2.tcs.ifi.lmu.de/~abel/>
>
>     _________________________________________________
>     Libraries mailing list
>     Libraries <at> haskell.org <mailto:Libraries <at> haskell.org>
>     http://www.haskell.org/__mailman/listinfo/libraries
>     <http://www.haskell.org/mailman/listinfo/libraries>
>
>

--

-- 
Andreas Abel  <><      Du bist der geliebte Mensch.

Theoretical Computer Science, University of Munich
Oettingenstr. 67, D-80538 Munich, GERMANY

andreas.abel <at> ifi.lmu.de
http://www2.tcs.ifi.lmu.de/~abel/

Gmane