
29 May
2012
29 May
'12
3:54 p.m.
On 29 May 2012 11:49, Evan Laforge
Good question.. I copied both to a file and tried ghc-core, but it inlines big chunks of Data.Vector and I can't read it very well, but it looks like the answer is no, it still builds the the list of sums. I guess the next step is to benchmark and see how busy the gc is on each version.
But my impression was that stream fusion can't handle early aborts, which was why I was wondering why Vector lacks a foldAbort type function.
Note that foldr allows early abort so that's fine. Also, there's no fundamental restriction due to stream fusion. Stream fusion can be used for lazy lists afterall and can implement Data.List.foldr just fine. Duncan