Advertisement
Guest User

advent of code 2020 day 18 part1

a guest
Dec 18th, 2020
110
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.  
  6. main :: IO ()
  7. main = print $ sum expr
  8.  
  9.  
  10. (+) x y = x P.+ y
  11. (*) x y = x P.* y
  12.  
  13. expr = [ 2 * 3 + (4 * 5)
  14.        , 5 + (8 * 3 + 9 + 3 * 4 * 3)
  15.        , 5 * 9 * (7 * 3 * 3 + 9 * 3 + (8 + 6 * 4))
  16.        , ((2 + 4 * 9) * (6 + 9 * 8 + 6) + 6) + 2 + 4 * 2]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement