Calc
Description
Synopsis
data Cmd Source #
The supported commands of the calculator.
Constructors
Instances
Methods
readsPrec :: Int -> ReadS Cmd #
readList :: ReadS [Cmd] #
readPrec :: ReadPrec Cmd #
readListPrec :: ReadPrec [Cmd] #
showsPrec :: Int -> Cmd -> ShowS #
show :: Cmd -> String #
showList :: [Cmd] -> ShowS #
exec :: Cmd -> Stack Int -> Stack Int Source #
Executing a single command on a given Stack.
Stack
calc :: Stack Int -> IO () Source #
The REPL of the calculator.
main :: IO () Source #
Initialize the REPL with the empty Stack.