
18 Mar
2009
18 Mar
'09
9:57 a.m.
Jon Fairbairn schrieb:
Melanie_Green
writes: What are the limitations of list comprehension. [...] a aa aaa
I'm not clear what you mean by the question. Why do you want to use list comprehensions? What if they aren't the best way of getting the result you want?
You can write
[a | b <- [replicate n 'a' | n <- [1..]], a <- b ++ "\n"]
but does that "replicate" fail to meet your specification?
Since we're »holfing« again: fix $ \xs -> [ 'a':xs | xs <- []:xs ]