sln_2022_21
Copyright(c) Eric Mertens 2022
LicenseISC
Maintaineremertens@gmail.com
Safe HaskellNone
LanguageHaskell2010

Main

Description

https://adventofcode.com/2022/day/21

>>> :{
:main +
  "root: pppw + sjmn\n\
  \dbpl: 5\n\
  \cczh: sllz + lgvd\n\
  \zczc: 2\n\
  \ptdq: humn - dvpt\n\
  \dvpt: 3\n\
  \lfqf: 4\n\
  \humn: 5\n\
  \ljgn: 2\n\
  \sjmn: drzm * dbpl\n\
  \sllz: 4\n\
  \pppw: cczh / lfqf\n\
  \lgvd: ljgn * ptdq\n\
  \drzm: hmdt - zczc\n\
  \hmdt: 32\n"
:}
152
301
Synopsis

Documentation

main :: IO () Source #

>>> :main
110181395003396
3721298272959

tie :: (Functor f, Ord a) => Map a (Fix f) -> f a -> Fix f Source #

pattern I :: Int -> Fix Expr Source #

data Expr a Source #

Constructors

Add a a 
Sub a a 
Mul a a 
Div a a 
Lit Int 
Answer 

Instances

Instances details
Functor Expr Source # 
Instance details

Defined in Main

Methods

fmap :: (a -> b) -> Expr a -> Expr b #

(<$) :: a -> Expr b -> Expr a #

Show a => Show (Expr a) Source # 
Instance details

Defined in Main

Methods

showsPrec :: Int -> Expr a -> ShowS #

show :: Expr a -> String #

showList :: [Expr a] -> ShowS #