aoc2021-0.1.0.0
Safe HaskellSafe-Inferred
LanguageHaskell2010

Day24

Description

 

Documentation

data Register Source #

Constructors

W 
X 
Y 
Z 

data Instruction a b Source #

Constructors

Inp a 
Add a (Either a b) 
Mul a (Either a b) 
Div a (Either a b) 
Mod a (Either a b) 
Eql a (Either a b) 

data State a Source #

Constructors

State 

Fields

  • w :: !a
     
  • x :: !a
     
  • y :: !a
     
  • z :: !a
     

get :: State a -> Register -> a Source #

set :: State a -> Register -> a -> State a Source #

run :: Integral a => [a] -> a -> [Instruction Register a] -> State a -> Maybe a Source #

runRange :: Integral a => (a, a) -> [Instruction Register (a, a)] -> State (a, a) -> Bool Source #