Created
January 4, 2018 19:31
-
-
Save msmorgan/2aeff4200f085af3073c1edd6e9f58d3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
term : MRule Expr | |
term = pure $ let (x, xs) = !multChain in | |
foldl (Binary Mul) x xs | |
where | |
multChain : MRule (Expr, List Expr) | |
multChain = do x <- factor | |
xs <- (do let op = match (Op Mul) | |
op | |
commit | |
sepBy1 op factor) <|> pure [] | |
pure (x, xs) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment