Okay, this time I'll make it clear, the job of function1 is to check a string if it comes up with the '?' thing, he will put the rest of the string in a list. if not, it will store everything in a stack, how can I do this
function2 :: [String] -> [([Char], [Integer]->[Integer])]
function1 :: [String] -> [Integer] -> ([Integer], String)
function1 [] stack = (stack, "")
function1 (x:xs) stack
| x == "?" = function2 xs -- # map the tokens after '?' to functions
-- # and put them into dictionary for
-- # function1's later use
| x == "m" = function1 xs ((read x :: b):stack)
| x == isJust lookup = eval xs (f stack)
...
where lookup = -- # lookup(f) is the function that is mapped from the token x