Skip to content

Commit

Permalink
docs: typo (#87)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jasha10 authored Aug 10, 2021
1 parent 9bb680d commit e4bc968
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/effectful_but_side_effect_free.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ lookup({'key': '42'}, 'key').and_then(maybe_is_42) # Just('42')
```
(For those with previous functional programming experience, `and_then` is the [bind](https://en.wikipedia.org/wiki/Monad_(functional_programming)#Overview) operation of `Maybe`)

`pfun.maybe.Maybe` is in fact just a [type-alias](https://docs.python.org/3/library/typing.html#type-aliases) for `Union[Just[TypeVar('A'), Nothing]]`. This means that your type checker can figure out when you're dealing with one or the other using either `__bool__` or `isinstance`, just like when using `Optional`:
`pfun.maybe.Maybe` is in fact just a [type-alias](https://docs.python.org/3/library/typing.html#type-aliases) for `Union[Just[TypeVar('A')], Nothing]`. This means that your type checker can figure out when you're dealing with one or the other using either `__bool__` or `isinstance`, just like when using `Optional`:
```python
value = lookup(some_dict, 'key')
if value:
Expand Down

0 comments on commit e4bc968

Please sign in to comment.