Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
mattiasnordqvist committed Feb 23, 2024
1 parent 1e9a5de commit 4babddf
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Results/ReadMe.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@

Given
```csharp
record DivideByZeroError : ErrorBase;
Result<int> Divide(int a, int b) => b == 0 ? Result<int>.Error(new DivideByZeroError()) : Result<int>.Ok(a / b);
Result<int> Multiply(int a, int b) => a * b;
```
Expand All @@ -15,8 +16,8 @@ These are all equivalent

var result = Divide(1, 2)
.Bind(x => Multiply(x, 2)
.Map(y => (x,y)))
.Bind((x,y) => Divide(y, x)
.Map(y => (x, y)))
.Bind((x, y) => Divide(y, x)
);

var result = Divide(1, 2)
Expand Down

0 comments on commit 4babddf

Please sign in to comment.