adamc@289: fun s2i s =
adamc@290:         case read _ s of
adamc@288:           None => 0
adamc@288:         | Some n => n
adamc@288: 
adamc@289: fun s2f s =
adamc@290:         case read _ s of
adamc@289:           None => 0.0
adamc@289:         | Some n => n
adamc@289: 
adamc@291: fun s2s s =
adamc@291:         case read _ s of
adamc@291:           None => "Error"
adamc@291:         | Some s => s
adamc@291: 
adamc@289: fun s2b s =
adamc@290:         case read _ s of
adamc@289:           None => False
adamc@289:         | Some b => b
adamc@289: 
adamc@288: fun main () : transaction page = return <html><body>
adamc@289:         Error = {cdata (show _ (s2i "Error"))}<br/>
adamc@289:         3 = {cdata (show _ (s2i "+3"))}<br/>
adamc@289:         <br/>
adamc@289:         Error = {cdata (show _ (s2f "Error"))}<br/>
adamc@289:         98.76 = {cdata (show _ (s2f "98.76"))}<br/>
adamc@289:         <br/>
adamc@289:         Error = {cdata (show _ (s2b "Error"))}<br/>
adamc@289:         False = {cdata (show _ (s2b "false"))}<br/>
adamc@289:         True = {cdata (show _ (s2b "trUE"))}<br/>
adamc@291:         <br/>
adamc@291:         Hi = {cdata (s2s "Hi")}<br/>
adamc@288: </body></html>