[Haskell-cafe] Re: Query on list comprehension
gale at sefer.org
Wed Mar 18 06:38:36 EDT 2009
>> 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..]]
unlines [replicate n 'a' | n <- [1..]]
More information about the Haskell-Cafe