Hoogle Search

Within LTS Haskell 22.21 (ghc-9.6.5)

Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.

  1. type HandlerT site (m :: Type -> Type) = HandlerFor site

    yesod-core Yesod.Core.Handler

    Deprecated: Use HandlerFor directly

  2. type HandlerT = Socket -> SockAddr -> SockAddr -> IO ()

    MissingH Network.SocketServer

    The main handler type. The first parameter is the socket itself. The second is the address of the remote endpoint. The third is the address of the local endpoint.

  3. type HandlerT site (m :: Type -> Type) = HandlerFor site

    classy-prelude-yesod ClassyPrelude.Yesod

    No documentation available.

  4. type HandlerT site (m :: Type -> Type) = HandlerFor site

    hledger-web Hledger.Web.Import

    No documentation available.

  5. handlerToIO :: MonadIO m => HandlerFor site (HandlerFor site a -> m a)

    yesod-core Yesod.Core.Handler

    Returns a function that runs HandlerFor actions inside IO. Sometimes you want to run an inner HandlerFor action outside the control flow of an HTTP request (on the outer HandlerFor action). For example, you may want to spawn a new thread:

    getFooR :: Handler RepHtml
    getFooR = do
    runInnerHandler <- handlerToIO
    liftIO $ forkIO $ runInnerHandler $ do
    Code here runs inside HandlerFor but on a new thread.
    This is the inner HandlerFor.
    ...
    Code here runs inside the request's control flow.
    This is the outer HandlerFor.
    ...
    
    Another use case for this function is creating a stream of server-sent events using HandlerFor actions (see yesod-eventsource). Most of the environment from the outer HandlerFor is preserved on the inner HandlerFor, however:
    • The request body is cleared (otherwise it would be very difficult to prevent huge memory leaks).
    • The cache is cleared (see cached).
    Changes to the response made inside the inner HandlerFor are ignored (e.g., session variables, cookies, response headers). This allows the inner HandlerFor to outlive the outer HandlerFor (e.g., on the forkIO example above, a response may be sent to the client without killing the new thread).

  6. handlerToWidget :: HandlerFor site a -> WidgetFor site a

    yesod-core Yesod.Core.Widget

    No documentation available.

  7. handlerToIO :: MonadIO m => HandlerFor site (HandlerFor site a -> m a)

    classy-prelude-yesod ClassyPrelude.Yesod

    Returns a function that runs HandlerFor actions inside IO. Sometimes you want to run an inner HandlerFor action outside the control flow of an HTTP request (on the outer HandlerFor action). For example, you may want to spawn a new thread:

    getFooR :: Handler RepHtml
    getFooR = do
    runInnerHandler <- handlerToIO
    liftIO $ forkIO $ runInnerHandler $ do
    Code here runs inside HandlerFor but on a new thread.
    This is the inner HandlerFor.
    ...
    Code here runs inside the request's control flow.
    This is the outer HandlerFor.
    ...
    
    Another use case for this function is creating a stream of server-sent events using HandlerFor actions (see yesod-eventsource). Most of the environment from the outer HandlerFor is preserved on the inner HandlerFor, however:
    • The request body is cleared (otherwise it would be very difficult to prevent huge memory leaks).
    • The cache is cleared (see cached).
    Changes to the response made inside the inner HandlerFor are ignored (e.g., session variables, cookies, response headers). This allows the inner HandlerFor to outlive the outer HandlerFor (e.g., on the forkIO example above, a response may be sent to the client without killing the new thread).

  8. handlerToWidget :: HandlerFor site a -> WidgetFor site a

    classy-prelude-yesod ClassyPrelude.Yesod

    No documentation available.

  9. handlerToIO :: MonadIO m => HandlerFor site (HandlerFor site a -> m a)

    hledger-web Hledger.Web.Import

    Returns a function that runs HandlerFor actions inside IO. Sometimes you want to run an inner HandlerFor action outside the control flow of an HTTP request (on the outer HandlerFor action). For example, you may want to spawn a new thread:

    getFooR :: Handler RepHtml
    getFooR = do
    runInnerHandler <- handlerToIO
    liftIO $ forkIO $ runInnerHandler $ do
    Code here runs inside HandlerFor but on a new thread.
    This is the inner HandlerFor.
    ...
    Code here runs inside the request's control flow.
    This is the outer HandlerFor.
    ...
    
    Another use case for this function is creating a stream of server-sent events using HandlerFor actions (see yesod-eventsource). Most of the environment from the outer HandlerFor is preserved on the inner HandlerFor, however:
    • The request body is cleared (otherwise it would be very difficult to prevent huge memory leaks).
    • The cache is cleared (see cached).
    Changes to the response made inside the inner HandlerFor are ignored (e.g., session variables, cookies, response headers). This allows the inner HandlerFor to outlive the outer HandlerFor (e.g., on the forkIO example above, a response may be sent to the client without killing the new thread).

  10. handlerToWidget :: HandlerFor site a -> WidgetFor site a

    hledger-web Hledger.Web.Import

    No documentation available.

Page 1 of 2 | Next