I have written the parser that reads the string input. That works. I have also written the evaluator that spits out the result. But there is one small detail that I'm having trouble implementing. Look at the following example:
+(sw+(2,2),sr)
The sw construct of this tiny language is suppose to evaluate "+(2,2)" and store it somewhere. The sr construct would read this storage area. The whole expression over would evaluate to 8.
My thoughts on it would be to use an extra parameter for the function eval, that stores the result. But I can't see that working out. Note I am new to haskell, so be kind. Oh, this is homework. So don't give me a solution, give me a hint.