
18 Mar
2009
18 Mar
'09
6:38 a.m.
Melanie_Green writes:
I want to use listcomprehension to output the pattern below...
Jón Fairbairn wrote:
Why do you want to use list comprehensions? What if they aren't the best way of getting the result you want?
unlines . tail . inits . repeat $ 'a'
concat [replicate n 'a' ++ "\n" | n <- [1..]]
Or: unlines [replicate n 'a' | n <- [1..]] -Yitz