bracketOnError, while, forever

Graham Klyne GK at ninebynine.org
Thu Feb 10 10:10:18 EST 2005


At 13:33 09/02/05 +0000, Malcolm Wallace wrote:
>Here's another one.  I'm not sure what to call it, since 'permutation'
>means something subtly different.
>
>     -- Given a list of alphabets, return all possible strings with one
>     -- symbol chosen from each alphabet respectively.
>     permute         :: [[a]] -> [[a]]
>     permute   []     = [[]]
>     permute (xs:xss) = [ f:fs | f <- xs, fs <- permute xss ]

Doesn't 'sequence' do that?

#g


------------
Graham Klyne
For email:
http://www.ninebynine.org/#Contact



More information about the Libraries mailing list