-\end{code}
-
-\begin{code}
-pprInstLoc :: InstLoc -> SDoc
-pprInstLoc (InstLoc orig locn _)
- = sep [text "arising from" <+> pp_orig orig,
- text "at" <+> ppr locn]
- where
- pp_orig (OccurrenceOf name) = hsep [ptext SLIT("use of"), quotes (ppr name)]
- pp_orig (IPOccOrigin name) = hsep [ptext SLIT("use of implicit parameter"), quotes (ppr name)]
- pp_orig (IPBindOrigin name) = hsep [ptext SLIT("binding for implicit parameter"), quotes (ppr name)]
- pp_orig RecordUpdOrigin = ptext SLIT("a record update")
- pp_orig (LiteralOrigin lit) = hsep [ptext SLIT("the literal"), quotes (ppr lit)]
- pp_orig (ArithSeqOrigin seq) = hsep [ptext SLIT("the arithmetic sequence"), quotes (ppr seq)]
- pp_orig (PArrSeqOrigin seq) = hsep [ptext SLIT("the parallel array sequence"), quotes (ppr seq)]
- pp_orig InstSigOrigin = ptext SLIT("instantiating a type signature")
- pp_orig InstScOrigin = ptext SLIT("the superclasses of an instance declaration")
- pp_orig DerivOrigin = ptext SLIT("the 'deriving' clause of a data type declaration")
- pp_orig StandAloneDerivOrigin = ptext SLIT("a 'deriving' declaration")
- pp_orig DefaultOrigin = ptext SLIT("a 'default' declaration")
- pp_orig DoOrigin = ptext SLIT("a do statement")
- pp_orig ProcOrigin = ptext SLIT("a proc expression")
- pp_orig (SigOrigin info) = pprSkolInfo info
+ | ImplicOrigin SDoc -- An implication constraint
+
+instance Outputable InstOrigin where
+ ppr (OccurrenceOf name) = hsep [ptext SLIT("a use of"), quotes (ppr name)]
+ ppr (IPOccOrigin name) = hsep [ptext SLIT("a use of implicit parameter"), quotes (ppr name)]
+ ppr (IPBindOrigin name) = hsep [ptext SLIT("a binding for implicit parameter"), quotes (ppr name)]
+ ppr RecordUpdOrigin = ptext SLIT("a record update")
+ ppr (LiteralOrigin lit) = hsep [ptext SLIT("the literal"), quotes (ppr lit)]
+ ppr (ArithSeqOrigin seq) = hsep [ptext SLIT("the arithmetic sequence"), quotes (ppr seq)]
+ ppr (PArrSeqOrigin seq) = hsep [ptext SLIT("the parallel array sequence"), quotes (ppr seq)]
+ ppr InstSigOrigin = ptext SLIT("instantiating a type signature")
+ ppr InstScOrigin = ptext SLIT("the superclasses of an instance declaration")
+ ppr DerivOrigin = ptext SLIT("the 'deriving' clause of a data type declaration")
+ ppr StandAloneDerivOrigin = ptext SLIT("a 'deriving' declaration")
+ ppr DefaultOrigin = ptext SLIT("a 'default' declaration")
+ ppr DoOrigin = ptext SLIT("a do statement")
+ ppr ProcOrigin = ptext SLIT("a proc expression")
+ ppr (ImplicOrigin doc) = doc
+ ppr (SigOrigin info) = pprSkolInfo info