purescript-lists
purescript-lists copied to clipboard
Why does lazy list foldr reverse into a temporary lazy list?
I get why https://github.com/purescript/purescript-lists/blob/v6.0.0/src/Data/List/Lazy/Types.purs#L121 does what it does with reverse, but it seems to me there is no reason to create a brand new temporary lazy list just to consume it left to right. How about pushing elements left to right into a temporary JavaScript array and then going right to left in that?