[Haskell-cafe] ANNOUNCE: polyToMonoid

1 view
Skip to first unread message

Kevin Jardine

unread,
Oct 14, 2010, 4:40:54 PM10/14/10
to haskel...@haskell.org
Polyvariadic functions that accept an indefinite number of possibly
multiple typed arguments are often useful but a bit difficult to
declare in Haskell. With some crucial assistance from Oleg Kiselyov,
I have created a library that supplies two very general polyvariadic
functions that can map their arguments into any monoid you specify.

All you need to do to use these is to specify the monoid and some
instances of a toMonoid function to map all the types you want to pass
as arguments into the monoid.

The functions can act as a sort of generalised list, but of course
there are also many interesting monoids which are not lists.

The library is now up on Hackage here:

http://hackage.haskell.org/package/polyToMonoid-0.1

along with detailed documentation and a few examples here:

http://hackage.haskell.org/packages/archive/polyToMonoid/0.1/doc/html/Data-PolyToMonoid.html

As you can see, the code is short and depends only upon the GHC base
library.

The original thread discussing the polyToMonoid idea is here:

http://groups.google.com/group/haskell-cafe/browse_thread/thread/737c6cf921b99e85

Comments and suggestions for improvement are welcome!

Kevin
_______________________________________________
Haskell-Cafe mailing list
Haskel...@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply all
Reply to author
Forward
0 new messages