Inference on most expressions. HM based.
Still have to figure out how to infer type of lambda variables, as well as how function application on polymorphic should work
This commit is contained in:
parent
a1e9624d5e
commit
73dc2e4b6a
12 changed files with 347 additions and 310 deletions
22
src/TypeChecker/TypeCheckerIr.hs
Normal file
22
src/TypeChecker/TypeCheckerIr.hs
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
{-# LANGUAGE LambdaCase #-}
|
||||
|
||||
module TypeChecker.TypeCheckerIr
|
||||
( Program(..)
|
||||
, Bind(..)
|
||||
, Ident
|
||||
, Type(..)
|
||||
, Const(..)
|
||||
, Exp(..)
|
||||
)
|
||||
where
|
||||
|
||||
import Grammar.Abs (Program(..), Bind(..), Ident, Type(..), Const(..))
|
||||
|
||||
data Exp
|
||||
= EAnn Exp Type
|
||||
| EId Ident Type
|
||||
| EConst Const Type
|
||||
| EApp Exp Exp Type
|
||||
| EAdd Exp Exp Type
|
||||
| EAbs Ident Exp Type
|
||||
deriving (Eq, Ord, Show, Read)
|
||||
Loading…
Add table
Add a link
Reference in a new issue