Haskell List generating infinite loop

Viewed 61

I am completely new to Haskell and came across this problem where I have a list 'a' constituting two lists and another list 'b'. But when I do a = b:a and try to print list 'a' afterwards, it starts an infinite loop every time, I am not sure why this is happening. Any help is much appreciated!

Prelude> a
[[0,1,2],[3,4,5]]
Prelude> b
[6,7,8]
Prelude> a = b:a
Prelude> a
0 Answers
Related