32 lines
589 B
Idris
32 lines
589 B
Idris
module Value
|
|
|
|
import Term
|
|
import Misc
|
|
|
|
import Data.Vect
|
|
|
|
%default total
|
|
|
|
mutual
|
|
public export
|
|
data Value : Type where
|
|
VType : Value
|
|
VGen : Nat -> Value
|
|
VApp : Value -> Value -> Value
|
|
VClos : Ctx n -> Term n -> Value
|
|
|
|
public export
|
|
Ctx : Index -> Type
|
|
Ctx i = Vect i Value
|
|
|
|
public export
|
|
ctx0 : Ctx 0
|
|
ctx0 = []
|
|
|
|
public export
|
|
Show Value where
|
|
show VType = "VType"
|
|
show (VGen i) = "VGen " ++ show i
|
|
show (VApp f x) = "VApp (" ++ show f ++ ") (" ++ show x ++ ")"
|
|
show (VClos e t) = "VClos (" ++ assert_total (show e) ++ ") (" ++ show t ++ ")"
|