1

Topic: [Haskell] the Interpreter of mathematical expressions

Kind day,  there Is a task to write the calculator on Haskell, yes not idle time, and what also some calculations could add in variables. In addition to it expressions register in reverse Polish notation. Actually, with the calculator of problems is not present - on any  such miracle is written for 5 minutes. The problem arose in that as these results between calculations to save. What task candidate solutions are?

2

Re: [Haskell] the Interpreter of mathematical expressions

Hello, marttry, you wrote: M> What there are task candidate solutions? In the form of a line, in the form of the list of tokens or right after input to assort in something of type data Expr = Value Double | Expr: +: Expr | Expr:-: Expr | Expr:*: Expr - | that there the calculator still is able

3

Re: [Haskell] the Interpreter of mathematical expressions

Hello, deniok, you wrote: D> Hello, marttry, you wrote: M>> What there are task candidate solutions? D> in the form of a line, in the form of the list of tokens or right after input to assort in something of type D> D> data Expr = Value Double D> | Expr: +: Expr D> | Expr:-: Expr D> | Expr:*: Expr D> - | that there calculator D> still is able Solved approximately so: before transmission of the list to function calculating expression I check in the expression presence of the character of transmission to a variable (->) and if variable assignment takes place I divide expression on "to" and "after", and I save the calculated variable in the list of variables. A question in other - whether too it, . Idiocy?