| CARVIEW |
Select Language
HTTP/2 200
server: nginx
date: Fri, 16 Jan 2026 18:44:01 GMT
content-type: application/octet-stream
content-length: 594
last-modified: Mon, 11 Jan 2021 21:17:27 GMT
module Main where
import Control.Applicative ((<$>), (<*>))
import Happstack.Server ( ServerPart, badRequest, nullConf
, ok, simpleHTTP)
import Happstack.Server.RqData (RqData, look, getDataFn)
helloRq :: RqData (String, String)
helloRq =
(,) <$> look "greeting" <*> look "noun"
helloPart :: ServerPart String
helloPart =
do r <- getDataFn helloRq
case r of
(Left e) ->
badRequest $ unlines e
(Right (greet, noun)) ->
ok $ greet ++ ", " ++ noun
main :: IO ()
main = simpleHTTP nullConf $ helloPart