{-# LANGUAGE InstanceSigs #-}

module AST where

import Control.Monad.Reader (Reader)

data Exp
  = Const Val
  | Var Var
  | App Exp Exp
  | Lambda Var Exp
  | Cond Exp Exp Exp
  | LetRec Var Var Exp Exp
    deriving (Show)

type Var = String

data Val
  = ValBool Bool
  | ValInt Int
  | ValFun (Val -> Val)

type Env = [(Var, Val)]

instance Show Val where
  show :: Val -> String
  show (ValBool b) = "ValBool " ++ show b
  show (ValInt i) = "ValInt " ++ show i
  show (ValFun _) = "ValFun <function>"



