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

Problematic solution for Validation semigroup instance #24

Open
chetnashah opened this issue Oct 16, 2019 · 1 comment
Open

Problematic solution for Validation semigroup instance #24

chetnashah opened this issue Oct 16, 2019 · 1 comment

Comments

@chetnashah
Copy link

If we see the text for Validation in book it is

instance Semigroup a =>Semigroup (Validation a b) where
(<>) = undefined

So it means the author intends the failures be combine via <> operation since it is provided in constraint.

We can probably refactor to pattern match with Failure a and Failure b and return Failure (a <> b)

@chetnashah
Copy link
Author

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