问题
i am in the process of learning haskell and i am currently trying to define a function using foldr for an rpn evaluator.
this is the function, it takes in a list of strings and returns it as an int any help is appreciated.
rpnRec :: [String] -> Int
for example:
rpnRec ["2", "4", "+"] = 6
however i know how to do this using foldl. Thank you
来源:https://stackoverflow.com/questions/59590468/how-to-define-a-function-using-foldr-for-rpn-in-haskell