-- RPNC - a Reverse Polish Notation Calculator

import Stack
import Operation as Op

process :: String -> Stack -> Stack
process "+" = Op.add
process "-" = Op.sub
process "*" = Op.mul
process "/" = Op.divide
process num = push $ read num

operateOnStack stack = do
    line <- getLine
    operateOnStack $ process line stack

main = operateOnStack $ Stack []
