The way it is right now the minimal definition for Foldable is the right fold.
This came from the old project, emulating Haskell but here in .NET, with strict evaluation we don't have any benefit of using a right fold as main foldable function.
It would probably make more sense to derive other functions from the left fold, but I was thinking that even more sense would make to derive everything from ToSeq so we can have laziness and if we're lucky derive some lazy functions from that. Another benefit is that IEnumerable is everywhere in .NET collections so we can hope to get more methods derived for free. Any thoughts?
The way it is right now the minimal definition for
Foldable
is the right fold. This came from the old project, emulating Haskell but here in .NET, with strict evaluation we don't have any benefit of using a right fold as main foldable function. It would probably make more sense to derive other functions from the left fold, but I was thinking that even more sense would make to derive everything fromToSeq
so we can have laziness and if we're lucky derive some lazy functions from that. Another benefit is that IEnumerable is everywhere in .NET collections so we can hope to get more methods derived for free. Any thoughts?