
12 Aug
2004
12 Aug
'04
3:06 p.m.
Well, as far as that goes, we can shave off a little bit (around 7%) this way: combs = mapM (\k->[0..k]) (As a bonus, it's even a bit more cryptic/symbolic, in the fine tradition of APL one-liner character-shavings.) But who's counting? :) :) :) -- Fritz Ruehr On Aug 11, 2004, at 3:22 PM, Mike Gunter wrote:
Why so long-winded :-)?
combs = mapM (enumFromTo 0)
mike
Lyle Kopnicky
writes: ... Here is the improved version:
combs [] = [[]] combs (n:r) = [i:cr | i <- [0..n], cr <- combs r] ...
Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe