module CC.Typed( module CC.Typed, module CC.Types ) where import CC.Types data ProgramT = ProgramT [DeclT] deriving (Show, Read) data DeclT = DefT DefT -- import? deriving (Show, Read) data DefT = FunctionT TypeT Name [Name] ExprT deriving (Show, Read) data TypeT = TFunT TypeT TypeT | TIntT | TyVar Int deriving (Show, Read) data ExprT = CallT TypeT ExprT ExprT | IntT Int | VarT Occ deriving (Show, Read) -- | Occurrence of a variable data Occ = Occ Name TypeT deriving (Show, Read) exprType :: ExprT -> TypeT exprType (CallT typ _ _) = typ exprType (IntT _) = TIntT exprType (VarT (Occ _ typ)) = typ