X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Ftypecheck%2FTcRnTypes.lhs;h=ca17355ebafcc0077c65d8bcfaeed590da5c08d2;hb=b3e722e9ff0aeedceeeeacc67d61e11a5ee5b92a;hp=7357669669d580b6b4733703573106cf588d7826;hpb=d2ce0f52d42edf32bb9f13796e6ba6edba8bd516;p=ghc-hetmet.git diff --git a/compiler/typecheck/TcRnTypes.lhs b/compiler/typecheck/TcRnTypes.lhs index 7357669..ca17355 100644 --- a/compiler/typecheck/TcRnTypes.lhs +++ b/compiler/typecheck/TcRnTypes.lhs @@ -848,13 +848,12 @@ ctLocOrigin (CtLoc o _ _) = o setCtLocOrigin :: CtLoc o -> o' -> CtLoc o' setCtLocOrigin (CtLoc _ s c) o = CtLoc o s c -pprArising :: CtLoc CtOrigin -> SDoc -pprArising loc = case ctLocOrigin loc of - TypeEqOrigin -> empty - _ -> text "arising from" <+> ppr (ctLocOrigin loc) +pprArising :: CtOrigin -> SDoc +pprArising (TypeEqOrigin {}) = empty +pprArising orig = text "arising from" <+> ppr orig pprArisingAt :: CtLoc CtOrigin -> SDoc -pprArisingAt loc = sep [pprArising loc, text "at" <+> ppr (ctLocSpan loc)] +pprArisingAt (CtLoc o s _) = sep [pprArising o, text "at" <+> ppr s] ------------------------------------------- -- CtOrigin gives the origin of *wanted* constraints @@ -864,7 +863,7 @@ data CtOrigin | SpecPragOrigin Name -- Specialisation pragma for identifier - | TypeEqOrigin + | TypeEqOrigin EqOrigin | IPOccOrigin (IPName Name) -- Occurrence of an implicit parameter @@ -919,7 +918,7 @@ pprO StandAloneDerivOrigin = ptext (sLit "a 'deriving' declaration") pprO DefaultOrigin = ptext (sLit "a 'default' declaration") pprO DoOrigin = ptext (sLit "a do statement") pprO ProcOrigin = ptext (sLit "a proc expression") -pprO TypeEqOrigin = ptext (sLit "an equality") +pprO (TypeEqOrigin eq) = ptext (sLit "an equality") <+> ppr eq pprO AnnOrigin = ptext (sLit "an annotation") instance Outputable EqOrigin where