@@ -324,30 +324,27 @@ Yesod libraries. Instead, the libraries provide the data type:
324324
325325[source, haskell]
326326----
327- data HandlerT site m a
327+ data HandlerFor site a
328328----
329329
330- And like +WidgetT +, this has three arguments: a base monad +m +, a monadic value
331- +a+, and the foundation data type +site+. Each application defines a +Handler+
332- synonym which constrains +site+ to that application's foundation data type, and
333- sets +m+ to +IO+ . If your foundation is +MyApp+, in other words, you'd have the
330+ And like +WidgetFor +, this has two arguments: a monadic value +a +, and
331+ the foundation data type +site+. Each application defines a +Handler+
332+ synonym which constrains +site+ to that application's foundation data
333+ type . If your foundation is +MyApp+, in other words, you'd have the
334334synonym:
335335
336336[source, haskell]
337337----
338- type Handler = HandlerT MyApp IO
338+ type Handler = HandlerFor MyApp
339339----
340340
341- We need to be able to modify the underlying monad when writing subsites, but
342- otherwise we'll use +IO+.
343-
344- The +HandlerT+ monad provides access to information about the user request
341+ The +HandlerFor+ monad provides access to information about the user request
345342(e.g. query-string parameters), allows modifying the response (e.g., response
346343headers), and more. This is the monad that most of your Yesod code will live
347344in.
348345
349- In addition, there's a type class called +MonadHandler+. Both +HandlerT + and
350- +WidgetT + are instances of this type class, allowing many common functions to
346+ In addition, there's a type class called +MonadHandler+. Both +HandlerFor + and
347+ +WidgetFor + are instances of this type class, allowing many common functions to
351348be used in both monads. If you see +MonadHandler+ in any API documentation, you
352349should remember that the function can be used in your +Handler+ functions.
353350
@@ -546,7 +543,7 @@ expiresAt:: Sets the Expires header to the specified date/time.
546543
547544=== I/O and debugging
548545
549- The +HandlerT + and +WidgetT + monad transformers are both instances of a number
546+ The +HandlerFor + and +WidgetFor + monad transformers are both instances of a number
550547of typeclasses. For this section, the important typeclasses are +MonadIO+ and
551548+MonadLogger+. The former allows you to perform arbitrary +IO+ actions inside
552549your handler, such as reading from a file. In order to achieve this, you just
@@ -558,7 +555,7 @@ sent. By default, logs are sent to standard output, in development all messages
558555are logged, and in production, warnings and errors are logged.
559556
560557Often times when logging, we want to know where in the source code the logging
561- occured . For this, +MonadLogger+ provides a number of convenience Template
558+ occurred . For this, +MonadLogger+ provides a number of convenience Template
562559Haskell functions which will automatically insert source code location into the
563560log messages. These functions are +$logDebug+, +$logInfo+, +$logWarn+, and
564561+$logError+. Let's look at a short example of some of these functions.
0 commit comments