@@ -40,7 +40,6 @@ import Language.PureScript.Pretty
4040import Language.PureScript.Types
4141import Language.PureScript.Names
4242import Language.PureScript.Kinds
43−import Language.PureScript.TypeClassDictionaries
4443
4544import qualified Text.PrettyPrint.Boxes as Box
4645
@@ -108,8 +107,9 @@ data SimpleErrorMessage
108107 | TypesDoNotUnify Type Type
109108 | KindsDoNotUnify Kind Kind
110109 | ConstrainedTypeUnified Type Type
111− | OverlappingInstances (Qualified ProperName) [Type] [DictionaryValue]
110+ | OverlappingInstances (Qualified ProperName) [Type] [Qualified Ident]
112111 | NoInstanceFound (Qualified ProperName) [Type]
112+ | PossiblyInfiniteInstance (Qualified ProperName) [Type]
113113 | CannotDerive (Qualified ProperName) [Type]
114114 | CannotFindDerivingType ProperName
115115 | DuplicateLabel String (Maybe Expr)
@@ -233,6 +233,7 @@ errorCode em = case unwrapErrorMessage em of
233233 ConstrainedTypeUnified{} -> "ConstrainedTypeUnified"
234234 OverlappingInstances{} -> "OverlappingInstances"
235235 NoInstanceFound{} -> "NoInstanceFound"
236+ PossiblyInfiniteInstance{} -> "PossiblyInfiniteInstance"
236237 CannotDerive{} -> "CannotDerive"
237238 CannotFindDerivingType{} -> "CannotFindDerivingType"
238239 DuplicateLabel{} -> "DuplicateLabel"
@@ -544,10 +545,12 @@ prettyPrintSingleError full level e = prettyPrintErrorMessage <$> onTypesInError
544545 ]
545546 goSimple (OverlappingInstances nm ts ds) =
546547 paras [ line $ "Overlapping instances found for " ++ show nm ++ " " ++ unwords (map prettyPrintTypeAtom ts) ++ ":"
547− , paras $ map prettyPrintDictionaryValue ds
548+ , line $ intercalate ", " (map show ds)
548549 ]
549550 goSimple (NoInstanceFound nm ts) =
550551 line $ "No instance found for " ++ show nm ++ " " ++ unwords (map prettyPrintTypeAtom ts)
552+ goSimple (PossiblyInfiniteInstance nm ts) =
553+ line $ "Instance for " ++ show nm ++ " " ++ unwords (map prettyPrintTypeAtom ts) ++ " is possibly infinite."
551554 goSimple (CannotDerive nm ts) =
552555 line $ "Cannot derive " ++ show nm ++ " instance for " ++ unwords (map prettyPrintTypeAtom ts)
553556 goSimple (CannotFindDerivingType nm) =
@@ -736,19 +739,6 @@ prettyPrintSingleError full level e = prettyPrintErrorMessage <$> onTypesInError
736739 indent :: Box.Box -> Box.Box
737740 indent = Box.moveRight 2
738741
739− -- |
740− -- Render a DictionaryValue fit for human consumption in error messages
741− --
742− prettyPrintDictionaryValue :: DictionaryValue -> Box.Box
743− prettyPrintDictionaryValue (LocalDictionaryValue _) = line "Dictionary in scope"
744− prettyPrintDictionaryValue (GlobalDictionaryValue nm) = line (show nm)
745− prettyPrintDictionaryValue (DependentDictionaryValue nm args) = paras [ line $ (show nm) ++ " via"
746− , indent $ paras $ map prettyPrintDictionaryValue args
747− ]
748− prettyPrintDictionaryValue (SubclassDictionaryValue sup nm _) = paras [ line $ (show nm) ++ " via superclass"
749− , indent $ prettyPrintDictionaryValue sup
750− ]
751−
752742 -- |
753743 -- Pretty print and export declaration
754744 --