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 RightBiased#| #153

Merged
merged 1 commit into from
Jul 19, 2021
Merged

Add RightBiased#| #153

merged 1 commit into from
Jul 19, 2021

Conversation

flash-gordon
Copy link
Member

It's an alias for .or

extend Dry::Monads[:result, :maybe]

Some(1) | None() # => Some(1)
Some(1) | None() | Some(2) # => Some(1)
None() | Some(1) | Some(2) # => Some(1)

Failure(:not_found) | Success(1) | Success(2) # => Success(1)

It's an alias for `.or`

```ruby
extend Dry::Monads[:result, :maybe]

Some(1) | None() # => Some(1)
Some(1) | None() | Some(2) # => Some(1)
None() | Some(1) | Some(2) # => Some(1)

Failure(:not_found) | Success(1) | Success(2) # => Success(1)
```
@flash-gordon flash-gordon requested a review from solnic as a code owner July 19, 2021 07:23
@flash-gordon flash-gordon merged commit b452332 into master Jul 19, 2021
@flash-gordon flash-gordon deleted the alias-right-biased-or branch July 19, 2021 08:42
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.

1 participant