on master help sign in
Merge pull request #1175 from turion/patch-1
48df410Oleg Grenrus
doc/tutorial/Server.lhs+4−4
@@ -599,7 +599,7 @@ $ curl -H 'Accept: text/html' http://localhost:8081/persons
599
599
600## The `Handler` monad
600## The `Handler` monad
601
601
602−At the heart of the handlers is the monad they run in, namely a newtype `Handler` around `ExceptT ServerErroror IO`
602+At the heart of the handlers is the monad they run in, namely a newtype `Handler` around `ExceptT ServerError IO`
603([haddock documentation for `ExceptT`](http://hackage.haskell.org/package/mtl-2.2.1/docs/Control-Monad-Except.html#t:ExceptT)).
603([haddock documentation for `ExceptT`](http://hackage.haskell.org/package/mtl-2.2.1/docs/Control-Monad-Except.html#t:ExceptT)).
604One might wonder: why this monad? The answer is that it is the
604One might wonder: why this monad? The answer is that it is the
605simplest monad with the following properties:
605simplest monad with the following properties:
@@ -622,7 +622,7 @@ action that either returns an error or a result.
622
622
623The module [`Control.Monad.Except`](https://hackage.haskell.org/package/mtl-2.2.1/docs/Control-Monad-Except.html#t:ExceptT)
623The module [`Control.Monad.Except`](https://hackage.haskell.org/package/mtl-2.2.1/docs/Control-Monad-Except.html#t:ExceptT)
624from which `ExceptT` comes is worth looking at.
624from which `ExceptT` comes is worth looking at.
625−Perhaps most importantly, `ExceptT` and `Handler` are an instances of `MonadError`, so
625+Perhaps most importantly, `ExceptT` and `Handler` are instances of `MonadError`, so
626`throwError` can be used to return an error from your handler (whereas `return`
626`throwError` can be used to return an error from your handler (whereas `return`
627 is enough to return a success).
627 is enough to return a success).
628
628
@@ -632,8 +632,8 @@ kind and abort early. The next two sections cover how to do just that.
632
632
633### Performing IO
633### Performing IO
634
634
635−Another important instances from the list above are `MonadIO m => MonadIO
635+Other important instances from the list above are `MonadIO m => MonadIO
636−(ExceptT e m)`, and therefore also `MonadIO Handler` as there is `MonadIO IO` instance.
636+(ExceptT e m)`, and therefore also `MonadIO Handler` as there is a `MonadIO IO` instance.
637[`MonadIO`](http://hackage.haskell.org/package/transformers-0.4.3.0/docs/Control-Monad-IO-Class.html)
637[`MonadIO`](http://hackage.haskell.org/package/transformers-0.4.3.0/docs/Control-Monad-IO-Class.html)
638is a class from the **transformers** package defined as:
638is a class from the **transformers** package defined as:
639
639