Merge pull request #1175 from turion/patch-1

Fix small typos in doc/tutorial/Server.lhs
This commit is contained in:
Oleg Grenrus 2019-04-20 11:57:32 +03:00 committed by GitHub
commit 48df41065f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -599,7 +599,7 @@ $ curl -H 'Accept: text/html' http://localhost:8081/persons
## The `Handler` monad ## The `Handler` monad
At the heart of the handlers is the monad they run in, namely a newtype `Handler` around `ExceptT ServerErroror IO` At the heart of the handlers is the monad they run in, namely a newtype `Handler` around `ExceptT ServerError IO`
([haddock documentation for `ExceptT`](http://hackage.haskell.org/package/mtl-2.2.1/docs/Control-Monad-Except.html#t:ExceptT)). ([haddock documentation for `ExceptT`](http://hackage.haskell.org/package/mtl-2.2.1/docs/Control-Monad-Except.html#t:ExceptT)).
One might wonder: why this monad? The answer is that it is the One might wonder: why this monad? The answer is that it is the
simplest monad with the following properties: simplest monad with the following properties:
@ -622,7 +622,7 @@ action that either returns an error or a result.
The module [`Control.Monad.Except`](https://hackage.haskell.org/package/mtl-2.2.1/docs/Control-Monad-Except.html#t:ExceptT) The module [`Control.Monad.Except`](https://hackage.haskell.org/package/mtl-2.2.1/docs/Control-Monad-Except.html#t:ExceptT)
from which `ExceptT` comes is worth looking at. from which `ExceptT` comes is worth looking at.
Perhaps most importantly, `ExceptT` and `Handler` are an instances of `MonadError`, so Perhaps most importantly, `ExceptT` and `Handler` are instances of `MonadError`, so
`throwError` can be used to return an error from your handler (whereas `return` `throwError` can be used to return an error from your handler (whereas `return`
is enough to return a success). is enough to return a success).
@ -632,8 +632,8 @@ kind and abort early. The next two sections cover how to do just that.
### Performing IO ### Performing IO
Another important instances from the list above are `MonadIO m => MonadIO Other important instances from the list above are `MonadIO m => MonadIO
(ExceptT e m)`, and therefore also `MonadIO Handler` as there is `MonadIO IO` instance. (ExceptT e m)`, and therefore also `MonadIO Handler` as there is a `MonadIO IO` instance.
[`MonadIO`](http://hackage.haskell.org/package/transformers-0.4.3.0/docs/Control-Monad-IO-Class.html) [`MonadIO`](http://hackage.haskell.org/package/transformers-0.4.3.0/docs/Control-Monad-IO-Class.html)
is a class from the **transformers** package defined as: is a class from the **transformers** package defined as: