Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import Prelude hiding ((+), (*))
- import qualified Prelude as P
- infixl 6 +, *
- main :: IO ()
- main = print $ sum expr
- (+) x y = x P.+ y
- (*) x y = x P.* y
- expr = [ 2 * 3 + (4 * 5)
- , 5 + (8 * 3 + 9 + 3 * 4 * 3)
- , 5 * 9 * (7 * 3 * 3 + 9 * 3 + (8 + 6 * 4))
- , ((2 + 4 * 9) * (6 + 9 * 8 + 6) + 6) + 2 + 4 * 2]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement