Skip to content

Happstack: Response

Ian Stewart-Binks edited this page Jan 15, 2015 · 1 revision

Under Construction

Response

To understand what the type Response means, let's first examine where Response is first used in Courseography.

In the server, you will find something along the lines of:

main :: IO ()
main = do
    -- Some IO code
    simpleHTTP nullConf $
      msum [ ...
           ]

The IO code is irrelevant for our understanding. What matters here is the simpleHTTP nullConf $ msum [...].

The type declaration for simpleHTTP is:

simpleHTTP :: ToMessage a => Conf -> ServerPartT IO a -> IO ()

What simpleHTTP takes in is a Conf, which does not concern us with respect to a Response, and a type that is extended from the ToMessage type class, wrapped in an IO monad and then wrapped in the ServerPartT monad.

The difference between Response and m0 Response