954dfc5f8022443b263e59e98d869c6c7c18ea3c
[coq-hetmet.git] / src / HaskCoreVars.v
1 (*********************************************************************************************************************************)
2 (* HaskCoreVars: basically GHC's Var.Var imported into Coqland                                                                   *)
3 (*********************************************************************************************************************************)
4
5 Generalizable All Variables.
6 Require Import Preamble.
7 Require Import General.
8 Require Import Coq.Strings.String.
9
10 (* GHC uses a single type for expression variables, type variables, and coercion variables; this is that type *)
11 Variable CoreVar          : Type.                                               Extract Inlined Constant CoreVar    => "Var.Var".
12 Variable coreVar_eq       : forall (a b:CoreVar), sumbool (a=b) (not (a=b)).    Extract Inlined Constant coreVar_eq => "(==)".
13 Variable coreVarToString  : CoreVar      -> string.  Extract Inlined Constant coreVarToString         => "outputableToString".
14 Axiom    coreVar_eq_refl  : forall v, (coreVar_eq v v) = (left _ (refl_equal v)).
15 Instance CoreVarEqDecidable : EqDecidable CoreVar := { eqd_dec            := coreVar_eq }.
16 Instance CoreVarToString : ToString CoreVar :=
17   { toString := coreVarToString }.