coercions and compositions
This commit is contained in:
parent
468ae7e444
commit
a5ccf0215a
25 changed files with 1344 additions and 651 deletions
34
lib/Quox/Syntax/Term/TyConKind.idr
Normal file
34
lib/Quox/Syntax/Term/TyConKind.idr
Normal file
|
@ -0,0 +1,34 @@
|
|||
module Quox.Syntax.Term.TyConKind
|
||||
|
||||
import Decidable.Equality
|
||||
import Derive.Prelude
|
||||
import Generics.Derive
|
||||
|
||||
%language ElabReflection
|
||||
%default total
|
||||
|
||||
|
||||
public export
|
||||
data TyConKind = KTYPE | KPi | KSig | KEnum | KEq | KNat | KBOX
|
||||
%name TyConKind k
|
||||
%runElab derive "TyConKind" [Eq.Eq, Ord.Ord, Show.Show, Generic, Meta, DecEq]
|
||||
|
||||
||| a list of all `TyConKind`s
|
||||
public export %inline
|
||||
allKinds : List TyConKind
|
||||
allKinds = %runElab do
|
||||
-- as a script so it stays up to date if there are more tycon kinds
|
||||
cs <- getCons $ fst !(lookupName "TyConKind")
|
||||
traverse (check . var) cs
|
||||
|
||||
|
||||
||| in `type-case`, how many variables are bound in this branch
|
||||
public export %inline
|
||||
arity : TyConKind -> Nat
|
||||
arity KTYPE = 0
|
||||
arity KPi = 2
|
||||
arity KSig = 2
|
||||
arity KEnum = 0
|
||||
arity KEq = 5
|
||||
arity KNat = 0
|
||||
arity KBOX = 1
|
Loading…
Add table
Add a link
Reference in a new issue