module Main where import Prelude hiding (head) import AnnotatedHTML import RawCGI import ImprovedCGI main = run addition addition :: CGI () addition = do b1 <- ask "Addition, Teil1" [TEXT "Gib die erste Zahl ein: " ,input_text "erste-zahl" 10] let Just erste_zahl = assocParm "erste-zahl" b1 b2 <- ask "Addition, Teil2" [TEXT "Die erste Zahl ist " ,TEXT erste_zahl ,TEXT ". Gib die zweite Zahl ein: " ,input_text "zweite-zahl" 10] let Just zweite_zahl = assocParm "zweite-zahl" b2 tell "Addition, Ergebnis" [TEXT erste_zahl ,TEXT " + " ,TEXT zweite_zahl ,TEXT " = " ,TEXT (show ((read erste_zahl + read zweite_zahl) :: Int))]