Skip to content

Commit d4409db

Browse files
committed
explain why these implementations of 'Maybe' and 'Result' have moderate encapsulation
1 parent 2dcb1d1 commit d4409db

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# Monads in C++
22

3+
Some common monads are easy to implement in C++.
4+
5+
Note that the implementations for 'Maybe' and 'Result' in this repository do _not_ strictly encapsulate the values.
6+
It is possible to check if there is a value in the Maybe, and unwrap it manually.
7+
Strictly speaking, this should not be allowed, and instead 'bind' or function lifting should be used to raise all functions into the monadic context.
8+
Since this is often non-trivial in C++, i.e. the possibility to manually unwrap the values has been left open.
9+
310
## Getting started
411

512
1. Install dependencies

0 commit comments

Comments
 (0)