You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
false = reserved ”false” >> return Fl<br />
zero = reservedOp ”0” >> return Zero<br />
expr :: Parser Expr<br />
expr = Ex.buildExpressionParser table factor<br />
factor :: Parser Expr<br />
factor =<br />
true<br />
false<br />
zero<br />
ifthen<br />
parens expr<br />
contents :: Parser a -> Parser a<br />
contents p = do<br />
Tok.whiteSpace lexer<br />
r Bool<br />
isVal Tr = True<br />
isVal Fl = True<br />
isVal t | isNum t = True<br />
isVal _ = False<br />
e evaluation of our languages uses the Maybe applicative to accommodate the fact that our reduction<br />
may halt at any level with a Nothing if the expression being reduced has reached a normal form or<br />
40