[Haskell-cafe] Combination-lock problem

Mike Gunter m at ryangunter.com
Wed Aug 11 18:22:39 EDT 2004


Why so long-winded :-)?

  combs = mapM (enumFromTo 0)

	mike

Lyle Kopnicky <lists at qseep.net> writes:
...
> Here is the
> improved version:
>
> combs [] = [[]]
> combs (n:r) = [i:cr | i <- [0..n], cr <- combs r]
...


More information about the Haskell-Cafe mailing list