Bug of Data.List.Lazy take
ibara1454 opened this issue · 1 comments
ibara1454 commented
My English isn't good so feel free to ask me if there is anything unclear.
Problem
I found a problem that take evaluate the value too early.
It always evaluate the next value which we don't need.
To show this, I construct a lazy constructed list (elements in the list will be constructed only when they are needed), and use spy to print the value when the it is evaluated.
Actually
Desire
> take 0 lazyl
fromStrict (Nil)
> take 1 lazyl
1
fromStrict ((Cons 1 Nil))ibara1454 commented
And I have made a pull request of this.
You can use it if you think it is OK.