in reply to Combinatorics problem

Not that you'll be able to turn in the perl list comprehensions one in for your homework either, but . . .

$ echo 'main=do{putStrLn $ unlines $ map show [ (x,y,z) | x <- [1,2], +y <- "ab", z <- "#*&"]}' | runhaskell (1,'a','#') (1,'a','*') (1,'a','&') (1,'b','#') (1,'b','*') (1,'b','&') (2,'a','#') (2,'a','*') (2,'a','&') (2,'b','#') (2,'b','*') (2,'b','&')

The cake is a lie.
The cake is a lie.
The cake is a lie.

Replies are listed 'Best First'.
Re^2: Combinatorics problem
by perlrocks (Acolyte) on Sep 04, 2009 at 00:45 UTC
    Thanks fletch. But could you please write your code a bit more clearly. I can't quite read it. Thanks