Generating alphanumeric combinations
In Haskell you can always use ;, see The Haskell Report.

So your original code could be written as an one-liner as follows:

import Data.List ; c 0 _ = [[]] ; c n xs = [ y:ys | y:xs' &lt;- tails xs, ys &lt;- c (n-1) xs'] ; main = mapM_ putStrLn . c 3 $ ['a' .. 'b'] ++ ['0' .. '1']


A small improvement - sequence_ . map f is mapM_ f.

Of course you'll lose the nice indentation.

IF you don't mind repeating elements (which is what you have in the original shell script), you can use replicateM:

import Control.Monad
main = mapM_ putStrLn . replicateM 3 $ ['a' .. 'b'] ++ ['0' .. '1']