can't use 'seeOther' and 'ok' functions together

1 view
Skip to first unread message

Michael Ilyin

unread,
Jan 15, 2008, 3:23:58 PM1/15/08
to HA...@googlegroups.com
Hello all,

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

Lemmih

unread,
Jan 15, 2008, 3:34:49 PM1/15/08
to HA...@googlegroups.com

You need 'ok $ toResponse "Hello world"'. Things aren't perfect yet.

--
Cheers,
Lemmih

Alex Jacobson

unread,
Jan 15, 2008, 4:01:20 PM1/15/08
to HA...@googlegroups.com
We will probably push an update soon that will make seeOther take a body
argument as well. Then this problem will go away.
(RFC2616 allows seeother to have a body).

-Alex-

Reply all
Reply to author
Forward
0 new messages