[Haskell-cafe] collection monads

Matthias Fischmann fis at wiwi.hu-berlin.de
Tue Oct 3 06:55:29 EDT 2006

another beginners question about monads: given the type

| data (Ix x) => Permutation x = Permutation [x]

i wanted to define

| instance Monad Permutation where
|     return xs = Permutation xs

but of course nothing about the monad class guarantees xs to be of
type list.  the monad class seems unsuitable for holding collections,
and i am inclined to not instantiate permutations.

just to be sure: is there any easy way to do it that i missed?

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://www.haskell.org/pipermail/haskell-cafe/attachments/20061003/f86a154c/attachment.bin

More information about the Haskell-Cafe mailing list