Mutually recursive evaluator in Haskell
问题 Update: I've added an answer that describes my final solution (hint: the single Expr data type wasn't sufficient). I'm writing an evaluator for a little expression language, but I'm stuck on the LetRec construct. This is the language: type Var = String type Binds = [(Var, Expr)] data Expr = Var Var | Lam Var Expr | App Expr Expr | Con Int | Sub Expr Expr | If Expr Expr Expr | Let Var Expr Expr | LetRec Binds Expr deriving (Show, Eq) And this this the evaluator so far: data Value = ValInt Int