[Haskell-beginners] Folding an applicative functor, wait, .. what?

Arlen Cuss celtic at sairyx.org
Sat Jan 8 23:25:45 CET 2011


On Sat, 2011-01-08 at 10:53 -0200, Felipe Almeida Lessa wrote:
> On Sat, Jan 8, 2011 at 10:45 AM, Arlen Cuss <celtic at sairyx.org> wrote:
> > I think there is probably an obvious solution I've missed... and hold on
> > a minute!
> >
> > map (mconcat [show, anotherFunc, yetAnotherFunc]) [1..20]
> >
> > I just stumbled upon this. While I'm not 100% confident on what's just
> > happened here, I thought I'd mail this out for everyone to enjoy the
> > learning process that has been this email.
> 
> That's the Monoid b => Monoid (a->b) instance [1], but I don't think
> it is anywhere near obvious =).

Right you are! I know what's going on now :-) Cheers!

> Cheers!
> 
> [1] http://hackage.haskell.org/packages/archive/base/4.3.0.0/doc/html/src/Data-Monoid.html#(line94)

Arlen


-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part
URL: <http://www.haskell.org/pipermail/beginners/attachments/20110109/59e64302/attachment.pgp>


More information about the Beginners mailing list