-
Notifications
You must be signed in to change notification settings - Fork 20
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
empty constructor with alternative #8
Comments
Aha! There's actually a function in the Barbies library, buniq that does exactly this. I think this could certainly lead to some more useful examples, though I'd agree that |
Hmm... True, |
Agreed - I'll leave it open until I make the change, if that's cool :) |
Added an example in the README :) |
As documentation explains you can create something out of nothing using
mempty
, which imposes aMonoid
constraint on every field which rules out a whole bunch of useful types.An alternative would be to impose constraint on functor -
Alternative f
can provide "something" filled with "nothing"nofoo
can be for exampleFoo Nothing
orFoo (Left "")
The text was updated successfully, but these errors were encountered: