ocramz / xeno

Fast Haskell XML parser
Other
118 stars 32 forks source link

Use `modify'` instead of `modify` in `fold` #42

Closed 0xd34df00d closed 3 years ago

0xd34df00d commented 4 years ago

With modify its space complexity is O(n), with modify' it might be O(1) if the underlying algorithm supports that.

In other words, looks like this fixes a space leak.

ocramz commented 3 years ago

Hi @0xd34df00d , thank you for the patch. What made you notice this problem, and/or could you supply a benchmark?