module IR where type Param = (Text, IRExpr) data IRExpr = Var {varName :: Text} | Star | Level {level :: Integer} | App { appFunc :: IRExpr , appArg :: IRExpr } | Abs { absParamName :: Text , absParamType :: IRExpr , absAscription :: Maybe IRExpr , absBody :: IRExpr } | Pi { piParamName :: Text , piParamType :: IRExpr , piAscription :: Maybe IRExpr , piBody :: IRExpr } | Let { letVarName :: Text , letAscription :: Maybe IRExpr , letValue :: IRExpr , letBody :: IRExpr } deriving (Show, Eq, Ord) data IRSectionDef = Section { sectionName :: Text , sectionContents :: [IRSectionDef] } | Variable { variableName :: Text , variableType :: IRExpr } | IRDef IRDef deriving (Show, Eq, Ord) data IRDef = Def { defName :: Text , defAscription :: Maybe IRExpr , defBody :: IRExpr } | Axiom { axiomName :: Text , axiomAscription :: IRExpr } deriving (Show, Eq, Ord) type IRProgram = [IRSectionDef]