Idris2/tests/idris2/basic044/Term.idr
Guillaume ALLAIS 7ccc47712e [ re #1087 ] Better error messages in the REPL
(as well as in type signatures now that I know how to do that)
2021-02-19 12:34:19 +00:00

34 lines
775 B
Idris

module Term
import Data.Fin
%logging 1
%logging "declare.def" 3
mutual
data Bdr : (cut : Bool) -> (vars : Nat) -> Type where
Lam : Bdr cut vars
Pi : Chk cut vars -> Bdr cut vars
-- Checkable terms (i.e. introduction forms)
data Chk : (cut : Bool) -> (vars : Nat) -> Type where
Bnd : Bdr cut vars -> Chk cut (S vars) -> Chk cut vars
Emb : Syn cut vars -> Chk cut n
-- Synthesisable terms (i.e. elimination forms)
data Syn : (cut : Bool) -> (vars : Nat) -> Type where
Var : Fin vars -> Syn cut vars
App : Syn cut vars -> Chk cut vars -> Syn cut vars
Cut : Chk True vars -> Typ True vars -> Syn True vars
Typ : (cut : Bool) -> (vars : Nat) -> Type
Typ = Chk
Term : Nat -> Type
Term = Chk True
NF : Nat -> Type
NF = Chk False