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

Accumulate errors in <!> #7

Open
gwils opened this issue Mar 7, 2018 · 1 comment
Open

Accumulate errors in <!> #7

gwils opened this issue Mar 7, 2018 · 1 comment

Comments

@gwils
Copy link
Member

gwils commented Mar 7, 2018

sv uses Validation to accumulate multiple errors in Applicative operations.
For example, consider a <*> b <*> c. If more than one of these fails, the errors from all of them are collected.
Now consider the Alt operation x <!> y <!> z. In this case, if more than one fails, only the errors from the last (z) are collected.

It would be better if all the errors were kept. But I speculate that having all the <*> and <!> errors show up at the same level could quite confusing and unclear. I wonder if we could build a tree structure full of errors, or otherwise tag that a group of errors came from a chain of <!>

@phadej
Copy link

phadej commented Aug 6, 2018

https://github.com/futurice/haskell-mega-repo/blob/f660b3dfc136d5e3b85f40766297a2897955f4ec/env-config/src/Futurice/EnvConfig.hs#L282-L308

And then you'll need a Lattice. I use a CNF, but a a tree would do too (which would preserve more of error structure).

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

2 participants