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

Data types à la carte or Trees that grow instead of custom parser #13

Open
psilospore opened this issue Jun 23, 2024 · 0 comments
Open

Comments

@psilospore
Copy link
Contributor

In my first iteration of my parsing logic. I had an ADT that represented the types that could be parsed. However this locked the potential types that could be used.

I then changed the API to take in a parsing function and provided a default one that is super general but might accidentally catch types it shouldn't or miss when it shouldn't. The default one matches on a general pattern that has worked in most cases.

Data types a la carte seems to consider how to solve the first case:
https://www.cambridge.org/core/journals/journal-of-functional-programming/article/data-types-a-la-carte/14416CB20C4637164EA9F77097909409

Trees that grow might be another approach: https://simon.peytonjones.org/assets/pdfs/trees-that-grow.pdf

I haven't read either paper. I saw a talk using the first paper so I think that can work.

I think this is a nice add but not necessary

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