
23 Jan
2010
23 Jan
'10
1:31 p.m.
Sorry I missed something:
evalStep (Add x y) = let (Val xEvaled) = evalStep x (Val yEvaled) = evalStep y in Val (xEvaled + yEvaled)
should work. So you either have to use this let binding or you have to add a getVal function. And this is why I love Haskell. By thinking about the code you notice that you really want evalStep :: Expression -> result where result is Float, Int or Ratianal or such. Then you can use the code I wrote in my previous mail. Marc Weber