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

Use Unit as a default argument for Success(), Failure(), Some() #71

Merged
merged 1 commit into from
Oct 7, 2018

Conversation

flash-gordon
Copy link
Member

I think it's a nice way to avoid things like Success(nil). We already had Unit but the ergonomics wasn't ideal.

include Dry::Monads::Result::Mixin
include Dry::Monads::Do

def call
  yield do_1
  yield do_2

  Success()
end

I think it's a nice way to avoid things like `Success(nil)`
@timriley
Copy link
Member

timriley commented Oct 7, 2018

Super nice improvement, @flash-gordon! 👍🏼

@flash-gordon flash-gordon merged commit 63de67d into master Oct 7, 2018
@flash-gordon flash-gordon deleted the feature/default-unit branch October 7, 2018 13:03
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