summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
8a66ac4)
Yes, it's that easy. Try out the difference between
1 * 2 + 3
and
1 * (2 + 3)
deriving Show
instance Read Expr where
deriving Show
instance Read Expr where
- readPrec = choice [ parseNum
+ readPrec = parens $ choice [ parseNum
, parseVar
, parseBinOp "<" 10 (Cmp LT)
, parseBinOp "+" 20 Add
, parseVar
, parseBinOp "<" 10 (Cmp LT)
, parseBinOp "+" 20 Add