Closed dikmax closed 8 years ago
Nice! I think you could make it a bit shorter by using a linked list (there is one in persistent
, which this lib depends on). I can merge you PR now and do the change myself, or you can give it a shot, as you wish.
Either way, thanks!
Actually I can't see how LinkedList could help here. So make it yourself. Thanks!
I meant that EmptyExpectation | SingleExpectation | CombinedExpectation is isomorphic to LinkedList
Published in version 0.14.5.
Nevermind about my remark: what you want is not a list but a tree (or a list with lazy concatenation), which is exactly what you have.
Idea behind optimization that errorMessage we use only when needed but computing expectations all the time. And operations on sets are very expensive. So I delay this operation until it really needed.
My test started working twice fast.