The following simple code
main = do control <- startSystemState
simpleHTTP [
method GET $ ok "Hello World",
method POST $ seeOther "/"
]
waitForTermination control
produces error
main.hs:10:23:
Couldn't match expected type `[Char]'
against inferred type `Response'
Expected type: ServerPartT IO [Char]
Inferred type: ServerPartT IO Response
In the expression: method POST $ seeOther "/"
In the first argument of `simpleHTTP', namely
`[method GET $ ok "Hello World", method POST $ seeOther "/"]'
The most strange thing that if I comment any of these methods,
compilation is ok. I see why it happens, but I don't understand how can
I use both 'ok' and 'seeOther' in one list?
Best regards,
Michael
You need 'ok $ toResponse "Hello world"'. Things aren't perfect yet.
--
Cheers,
Lemmih
-Alex-