lemming at henning-thielemann.de
Tue Jun 6 08:15:20 EDT 2006
On Tue, 6 Jun 2006 developer at imaginando.net wrote:
> I need a functions which takes as argument a list of lists like this one:
> and gives me a list of list with all the possible combinations like this one:
> In this case there are only 2 combinations but if there was more than one
> element in the other lists the results were much more.
Using the List instance of monads you can simplify things.
foldr (Monad.liftM2 (:)) [] [[1,2],,]
> I'm a little stuck in this simple problem.
> First i was thinking in cartesian product but then i realized that i may
> not be what i really need.
cartesian product can be computed by
More information about the Haskell-Cafe