
On Jun 6, 2013, at 5:56 PM, Brent Yorgey
On Thu, Jun 06, 2013 at 05:27:11PM -0700, Frerich Raabe wrote:
I could do something like
data List a = Singleton a | Cons a (List a)
but before I go ahead I wonder: is there an existing Haskell package for this? Maybe even with prettier names than what I wrote above, and convenient functions for transforming from/to plain [] lists? It would probably be straightforward to write it myself, but because of that, I suspect that somebody else already did it. :-)
Yes, this exists in the semigroups package:
http://hackage.haskell.org/packages/archive/semigroups/0.9.2/doc/html/Data-L...
Awesome, thanks a lot for pointing this out! semigroups… I don't even know what that would be, pretty sure I wouldn't have found this by myself. :-} -- Frerich Raabe - raabe@froglogic.com www.froglogic.com - Multi-Platform GUI Testing