[Haskell-cafe] Combination-lock problem

lists at qseep.net lists at qseep.net
Thu Aug 12 14:50:07 EDT 2004


I bow to your superior ingenuity.  :)

- Lyle

>
> 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