add ToLatex instance for TyCon/TyFun
authorAdam Megacz <megacz@cs.berkeley.edu>
Fri, 25 Mar 2011 18:22:04 +0000 (11:22 -0700)
committerAdam Megacz <megacz@cs.berkeley.edu>
Fri, 25 Mar 2011 18:22:04 +0000 (11:22 -0700)
src/HaskLiteralsAndTyCons.v
src/HaskProofToLatex.v

index 0592f3a..a0695d2 100644 (file)
@@ -86,6 +86,8 @@ Variable tyConToString   : TyCon   -> string.     Extract Inlined Constant tyCon
 Variable tyFunToString   : TyFun   -> string.     Extract Inlined Constant tyFunToString         => "outputableToString".
 Instance TyConToString   : ToString TyCon := { toString := tyConToString }.
 Instance TyFunToString   : ToString TyFun := { toString := tyFunToString }.
+Instance TyConToLatex    : ToLatex  TyCon := { toLatex  := fun x => latex (sanitizeForLatex (toString x)) }.
+Instance TyFunToLatex    : ToLatex  TyCon := { toLatex  := fun x => latex (sanitizeForLatex (toString x)) }.
 
 Variable ModalBoxTyCon   : TyCon.        Extract Inlined Constant ModalBoxTyCon => "TysWiredIn.hetMetCodeTypeTyCon".
 Variable ArrowTyCon      : TyCon.        Extract Constant ArrowTyCon    => "Type.funTyCon".
index fab70fe..d99469c 100644 (file)
@@ -27,10 +27,6 @@ Section HaskProofToLatex.
   Definition FreshM' := FMT freshM.
   Instance FreshMon' : Monad FreshM' := FMT_Monad freshM.
   
-  Instance ToLatexTyCon : ToLatex TyCon.
-    admit.
-    Defined.
-
   Fixpoint typeToLatex (needparens:bool){κ}(t:RawHaskType TV κ) {struct t} : FMT freshM Latex :=
     match t with
     | TVar    _ v        => return toLatex v