Skip to content
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

Minimize custom code in Fold #81

Open
rtar opened this issue Sep 29, 2020 · 0 comments
Open

Minimize custom code in Fold #81

rtar opened this issue Sep 29, 2020 · 0 comments

Comments

@rtar
Copy link
Contributor

rtar commented Sep 29, 2020

Right now Fold contains a lot of custom code and syntax to make constructing and combining Fold instances easier. It may make understanding of the whole library harder, because one will have to learn a domain specific language.

The idea is to investigate prior art and reuse as much syntax as possible for Fold. I.e. Fold is actually Kleisli[F, (S, A), S], so monad syntax could be reused from it etc. The key idea could be making a less restrictive type such as IndexedFold[F, (S1, A), S2] and then reuse functionality from Kleisli to define methods for original Fold[F, S, A].

See also similar structure here:
https://github.com/notxcain/aecor/blob/master/modules/core/src/main/scala/aecor/data/Fold.scala

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant