-Definition tyConKind (tc:TyCon) : list Kind :=
- map (fun (x:WeakTypeVar) => x:Kind) (tyConTyVars tc).
-Variable tyFunResultKind : CoreTyCon -> Kind. Extract Inlined Constant tyFunResultKind => "tyFunResultKind".
-Definition tyFunKind (tc:TyFun) : ((list Kind) * Kind) :=
- ((map (fun (x:WeakTypeVar) => x:Kind) (tyConTyVars tc)) , (tyFunResultKind tc)).
-
-(* EqDecidable instances for all of the above *)
-Instance WeakCoerVarEqDecidable : EqDecidable WeakCoerVar.
- apply Build_EqDecidable.
- intros.
- destruct v1 as [cv1 t1a t1b].
- destruct v2 as [cv2 t2a t2b].
- destruct (eqd_dec cv1 cv2); subst.
- destruct (eqd_dec t1a t2a); subst.
- destruct (eqd_dec t1b t2b); subst.
- left; auto.
- right; intro; apply n; inversion H; subst; auto.
- right; intro; apply n; inversion H; subst; auto.
- right; intro; apply n; inversion H; subst; auto.
- Defined.
-
-Instance WeakExprVarEqDecidable : EqDecidable WeakExprVar.
- apply Build_EqDecidable.
- intros.
- destruct v1 as [cv1 k1].
- destruct v2 as [cv2 k2].
- destruct (eqd_dec cv1 cv2); subst.
- destruct (eqd_dec k1 k2); subst.
- left; auto.
- right; intro; apply n; inversion H; subst; auto.
- right; intro; apply n; inversion H; subst; auto.
- Defined.
-
-Instance WeakVarEqDecidable : EqDecidable WeakVar.
- apply Build_EqDecidable.
- induction v1; destruct v2; try (right; intro q; inversion q; fail) ; auto;
- destruct (eqd_dec w w0); subst.
- left; auto.
- right; intro X; apply n; inversion X; auto.
- left; auto.
- right; intro X; apply n; inversion X; auto.
- left; auto.
- right; intro X; apply n; inversion X; auto.
- Defined.