module StackMachine where import System.IO type Transition state input output = (state, input) -> (state, output) process :: Transition state input output -> state -> [input] -> [output] process tr s [] = [] -- the definition of the function ``process'' is still incomplete! -- You do not need to understand the details of the ``runprocess'' function runprocess :: Transition state String String -> state -> IO () runprocess tr s = do hSetBuffering stdout LineBuffering -- requires: ``import System.IO'' interact (unlines . process tr s . lines) -- uncomment the type signatures below as you define the functions! -- countEcho :: Transition Integer String String -- trAdd :: Transition Integer String String -- polish :: Transition [Integer] String String