Skip to content

Commit 9cd1405

Browse files
authored
Merge pull request #16 from LoopPerfect/njlr-patch-1
Update README.md
2 parents 8d0725c + 7ea9c68 commit 9cd1405

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

README.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,16 @@
44

55
A functional implementation of Either in C++14.
66

7+
[![Travis](https://img.shields.io/travis/LoopPerfect/neither.svg)](https://travis-ci.org/LoopPerfect/neither) [![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/LoopPerfect/neither/master/license)
8+
79
```
810
buckaroo install loopperfect/neither
911
```
1012

11-
## Introductory Example
13+
## Examples
1214

1315

14-
### Handling Unsafe code
16+
### Handling Unsafe Code
1517
```c++
1618

1719
auto unsafe = [] { // a function that throws, sometimes we can't avoid it...
@@ -37,7 +39,8 @@ ASSERT_TRUE(result == 42);
3739

3840
```
3941
40-
### Another Either Example
42+
### Another Example
43+
4144
```c++
4245
Either<std::string, int> compute(int x) {
4346
if(x<0) return left("don't pass x<0");
@@ -79,6 +82,7 @@ void compose() {
7982
```
8083

8184
### Maybe Example
85+
8286
```c++
8387

8488
Maybe<float> compute(float x) {
@@ -112,6 +116,7 @@ ASSERT_TRUE( monadicSum( maybe(), maybe(1) ).hasValue == false);
112116
```
113117

114118
## Why Eithers? - Learned Lessons About Error handling
119+
115120
Some useful references:
116121

117122
- Benchmarks: [Mongrel Monads, Dirty, Dirty, Dirty - Niall Douglas [ACCU 2017]](https://youtu.be/XVofgKH-uu4?t=1h)

0 commit comments

Comments
 (0)