
13 Feb
2008
13 Feb
'08
5:36 a.m.
On Feb 13, 2008 9:33 AM,
The approach is based on the final tagless representation. Here is our DSL:
class Exp repr where constant :: Int -> repr Int variable :: String -> repr Int add :: repr Int -> repr Int -> repr Int sub :: repr Int -> repr Int -> repr Int
This is very nice. May I ask, though, what is the purpose of all the Ints appearing as arguments to repr here? Looking over this code, it seems that it would work just as well if they were all omitted. Thanks, Luke