So, I was reading a book, "An Introduction to Formal Language Theory" and it describes a language L(G) = {a^n ++ b^n | n > 0}.
It has the following productions:
S -> ab | aSb
And so would produce the following language:
a, ab, aabb, aaabbb, ...
I was wondering how I could use Haskell's list comprehension to create this language. I know I can do list comprehension with strings, but I'm pretty much of a beginner and wasn't sure how I could get an infinite list like I would like of these strings.
I'm imagining something like:
[ x ++ y | x <- ["a","aa",..] y <- ["b","bb",..]]