-- checks if the state is final (elevator at 4th floor and all floors below 4 empty)
stateIsFinal :: State -> Bool
stateIsFinal (State f v) = f == 3 && v .&. 0xffffffffffff == 0
stateIsFinal :: State -> Bool
stateIsFinal (State f v) = f == 3 && v .&. 0xffffffffffff == 0
stateIsFinal (State f v) = f == 3 && v .&. 0xffffffffffff == 0