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

Why the Monoid constraint on the error type? #157

Open
moll opened this issue Nov 21, 2019 · 1 comment
Open

Why the Monoid constraint on the error type? #157

moll opened this issue Nov 21, 2019 · 1 comment

Comments

@moll
Copy link

moll commented Nov 21, 2019

Hey, I noticed #114 added Monoid constraints to a lot of functions. I don't understand why. Isn't the error type in Form error m value supposed to be for one error? The example check "Cannot be empty" (not . null) sure hints that, too. In that case, it makes no sense for the error type to have an identity element or even the Semigroup's combining. The errors function already returns a list, further hinting Monoid is redundant.

Thanks!

@moll
Copy link
Author

moll commented Nov 21, 2019

I suspect this is related to the weird Applicative instance in http://hackage.haskell.org/package/digestive-functors-0.8.4.0/docs/src/Text.Digestive.Types.html#Result which caused the Monoid problem in #113 in the first place. If anything, Result looks like a semigroup, which is what the implementation of <*> seemed to be going for.

Related to #147.

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