Advertisement
Guest User

advent of code 2020 day 18 part2

a guest
Dec 18th, 2020
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import Prelude hiding ((+), (*))
  2. import qualified Prelude as P
  3.  
  4. infixl 6 *
  5. infixl 7 +
  6.  
  7. main :: IO ()
  8. main = print $ sum expr
  9.  
  10.  
  11. (+) x y = x P.+ y
  12. (*) x y = x P.* y
  13.  
  14. expr = [ 2 * 3 + (4 * 5)
  15.        , 5 + (8 * 3 + 9 + 3 * 4 * 3)
  16.        , 5 * 9 * (7 * 3 * 3 + 9 * 3 + (8 + 6 * 4))
  17.        , ((2 + 4 * 9) * (6 + 9 * 8 + 6) + 6) + 2 + 4 * 2]
  18.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement