Simplify TcSimplify, by removing Free
[ghc-hetmet.git] / compiler / typecheck / TcRnTypes.lhs
index dc23308..42f4ff4 100644 (file)
@@ -30,7 +30,7 @@ module TcRnTypes(
        -- Insts
        Inst(..), InstOrigin(..), InstLoc(..), 
        pprInstLoc, pprInstArising, instLocSpan, instLocOrigin,
-       LIE, emptyLIE, unitLIE, plusLIE, consLIE, 
+       LIE, emptyLIE, unitLIE, plusLIE, consLIE, instLoc, instSpan,
        plusLIEs, mkLIE, isEmptyLIE, lieToList, listToLIE,
 
        -- Misc other types
@@ -598,8 +598,9 @@ data Inst
   | ImplicInst {       -- An implication constraint
                        -- forall tvs. (reft, given) => wanted
        tci_name   :: Name,
+       tci_tyvars :: [TcTyVar],    -- Includes coercion variables
+                                   --   mentioned in tci_reft
        tci_reft   :: Refinement,
-       tci_tyvars :: [TcTyVar],
        tci_given  :: [Inst],       -- Only Dicts
                                    --   (no Methods, LitInsts, ImplicInsts)
        tci_wanted :: [Inst],       -- Only Dicts and ImplicInsts
@@ -725,6 +726,12 @@ functions that deal with it.
 -------------------------------------------
 data InstLoc = InstLoc InstOrigin SrcSpan ErrCtxt
 
+instLoc :: Inst -> InstLoc
+instLoc inst = tci_loc inst
+
+instSpan :: Inst -> SrcSpan
+instSpan wanted = instLocSpan (instLoc wanted)
+
 instLocSpan :: InstLoc -> SrcSpan
 instLocSpan (InstLoc _ s _) = s