An interpreted, lazy lisp.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

17 lines
641 B

||| Type inference
module Inference
TypeEnvironment : Type -> Type where
TypeEnv : r -> List (Int, r)
interface (Base r) => Inferable
(t : Type) -- Representation of types
(v : Type) -- Type variables--should be a specialization over t
(m : Type -> Type -> Type) -- Container for type/variable associations
(e : Type -> Type) where -- Type environment
generate : (e (m v t)) -> v
extend : (e (m v t)) -> (m v t) -> (e (m v t))
lookup : (e (m v t)) -> v -> Maybe t
substitute : (e (m v t)) -> t -> t
unify : t -> t -> (e (m v t)) -> Either String (e (m v t))
free : v -> t -> (e (m v t)) -> Bool