X-Git-Url: http://git.megacz.com/?p=coq-hetmet.git;a=blobdiff_plain;f=src%2FHaskKinds.v;h=d575d12da0d535351ff97076143bdc5b073ae7b0;hp=54a1f64459375759e49cbf6d13edd7719ed05f2d;hb=57e387249da84dac0f1c5a9411e3900831ce2d81;hpb=3d56944e3882ec751fa99b4476a013c4d86fd0f8 diff --git a/src/HaskKinds.v b/src/HaskKinds.v index 54a1f64..d575d12 100644 --- a/src/HaskKinds.v +++ b/src/HaskKinds.v @@ -12,7 +12,6 @@ Variable Note : Type. Extract Inlined Con Variable natToString : nat -> string. Extract Inlined Constant natToString => "natToString". Instance NatToStringInstance : ToString nat := { toString := natToString }. -(* Figure 7: production κ, ι *) Inductive Kind : Type := | KindStar : Kind (* ★ - the kind of coercions and the kind of types inhabited by [boxed] values *) | KindArrow : Kind -> Kind -> Kind (* ⇛ - type-function-space; things of kind X⇛Y are NOT inhabited by expressions*) @@ -38,6 +37,22 @@ Instance KindToString : ToString Kind := { toString := kindToString }. Notation "'★'" := KindStar. Notation "a ⇛ b" := (KindArrow a b). +(* the kind of environment classifiers *) +Definition ECKind := ★ ⇛ ★ ⇛ ★. +Opaque ECKind. + +Fixpoint kindToLatexMath (k:Kind) : LatexMath := + match k with + | ★ => rawLatexMath "\star" + | ★ ⇛ k2 => (rawLatexMath "\star\Rightarrow ")+++kindToLatexMath k2 + | k1 ⇛ k2 => (rawLatexMath "(")+++kindToLatexMath k1+++(rawLatexMath ")\Rightarrow ")+++kindToLatexMath k2 + | KindUnliftedType => rawLatexMath "\text{\tt{\#}}" + | KindUnboxedTuple => rawLatexMath "\text{\tt{(\#)}}" + | KindArgType => rawLatexMath "\text{\tt{??}}" + | KindOpenType => rawLatexMath "\text{\tt{?}}" + end. +Instance KindToLatexMath : ToLatexMath Kind := { toLatexMath := kindToLatexMath }. + Instance KindEqDecidable : EqDecidable Kind. apply Build_EqDecidable. induction v1.