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

Add boolean combine for Maybe #2

Merged
merged 1 commit into from
Nov 27, 2016
Merged

Conversation

duythinht
Copy link
Contributor

@duythinht duythinht commented Nov 26, 2016

In my opinion we need combine Maybe instance by boolean operator.
For example when I want to check a value is None and return Nothing instead of Just(None)

return value and Just(value) or Nothing()

Should be

return Just(value) or Nothing()

@dbrattli dbrattli merged commit 62b26e6 into dbrattli:master Nov 27, 2016
@dbrattli
Copy link
Owner

Thanks, this is great idea! A bit unsure if I want to use .value, (as it is sort of a hack) and perhaps impl. __bool__() for both Nothing and Maybe. But I can change that later if I decide to do it that way.

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

Successfully merging this pull request may close these issues.

2 participants