-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Alternative approaches #2
Comments
xgrommx data Moore a b = Moore b (a -> Moore a b) -- ~ Fold a b -- Moore a b ~ Cofree ((->) a) b -- Moore a b ~ Cofree ((->) a) b ~ exists x. Tuple (Tuple (x -> b) (x -> a -> x)) x data FoldF a b x = FoldF (x -> a -> x) x (x -> b) -- Moore a b ~ Fold a b natefaubion |
The isomorphism between
|
It's been pointed out that
Fold
is isomorphic to a Moore machine, and there's apurescript-folds
package that doesn't use the existential type. According to Nate Faubion:I still haven't digested that—does it mean the encoding using the existential type (this one as opposed to that in
purescript-folds
) is more efficient somehow?Further reading:
Kmett on
Moore
& transducers: https://www.schoolofhaskell.com/user/edwardk/moore/for-lessAlternative fold libraries (since I don't know where else to track these):
https://github.com/metrix-ai/deferred-folds
https://github.com/effectfully/prefolds
https://github.com/ekmett/folds
The text was updated successfully, but these errors were encountered: