1
1
mirror of https://github.com/thma/LtuPatternFactory.git synced 2024-12-04 12:43:14 +03:00

fixing typos

This commit is contained in:
thma 2018-12-28 09:55:36 +01:00
parent 2a4b095861
commit 95918ae827

View File

@ -674,10 +674,10 @@ instance Monad Maybe where
This elegant feature of `(>>=)` in the `Maybe` Monad allows us to avoid ugly and repetetive coding.
#### Avoiding partial function by using Maybe
#### Avoiding partial functions by using Maybe
Maybe is often used to avoid any kind of partial functions. Take for example division by zero or computing the square root of negative numbers which are undefined (at least for real numbers).
Here come safe definitions of these functions that return `Nothing` for undefined cases:
Maybe is often used to avoid the exposure of partial functions to client code. Take for example division by zero or computing the square root of negative numbers which are undefined (at least for real numbers).
Here come safe – that is total – definitions of these functions that return `Nothing` for undefined cases:
```haskell
safeRoot :: Double -> Maybe Double
@ -712,7 +712,7 @@ There are many predefined Monads available in the Haskell curated libraries and
[Sourcecode for this section](https://github.com/thma/LtuPatternFactory/blob/master/src/NullObject.hs)
<!--
#### TBD: Reimplementing the Evaluator with Writer-Monad
#### TBD: Reimplementing the Evaluator with Reader-Monad
-->
### Composite → SemiGroup → Monoid