Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
import Network.CGI
import Text.XHtml
inputForm = form << [paragraph << ("My name is " +++ textfield "name"),
submit "" "Submit"]
greet n = paragraph << ("Hello " ++ n ++ "!")
page t b = header << thetitle << t +++ body << b
cgiMain = do mn <- getInput "name"
let x = maybe inputForm greet mn
output . renderHtml $ page "Input example" x
main = runCGI $ handleErrors cgiMain
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.