Skip to content

Instantly share code, notes, and snippets.

@voidlizard
Created January 7, 2011 11:18
Show Gist options
  • Save voidlizard/769363 to your computer and use it in GitHub Desktop.
Save voidlizard/769363 to your computer and use it in GitHub Desktop.
insertEntity :: Context -> String -> ServerPartT IO Response
insertEntity serv w =
methodM GET >> do withData (\d -> handle serv w d)
where handle ctx t (TestGet p) = do
x <- liftIO (doInsertIntoTable ctx t p)
--- написав это сам, Дик Бёрд (ну или Бивис) впервые поверил, что он сможет освоить хаскель
res <- case x of
Nack(x) -> do fail x; return "<error/>" -- и особенно вот это
Ack _ -> return "<ok/>"
ok $ contentTypeXml $ toResponse res
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment