git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Improve "error in type class" message
a7d25f2Gary Burgess
src/Language/PureScript/Sugar/TypeClasses.hs+2−1
@@ -25,6 +25,7 @@ import Language.PureScript.CodeGen.JS.AST
25import Language.PureScript.Sugar.CaseDeclarations
25import Language.PureScript.Sugar.CaseDeclarations
26import Language.PureScript.Environment
26import Language.PureScript.Environment
27import Language.PureScript.Errors
27import Language.PureScript.Errors
28+import Language.PureScript.Pretty.Types (prettyPrintTypeAtom)
28import Language.PureScript.CodeGen.Common (identToJs)
29import Language.PureScript.CodeGen.Common (identToJs)
29
30
30import qualified Language.PureScript.Constants as C
31import qualified Language.PureScript.Constants as C
@@ -158,7 +159,7 @@ unit = TypeApp tyObject REmpty
158
159
159typeInstanceDictionaryDeclaration :: Ident -> ModuleName -> [(Qualified ProperName, [Type])] -> Qualified ProperName -> [Type] -> [Declaration] -> Desugar Declaration
160typeInstanceDictionaryDeclaration :: Ident -> ModuleName -> [(Qualified ProperName, [Type])] -> Qualified ProperName -> [Type] -> [Declaration] -> Desugar Declaration
160typeInstanceDictionaryDeclaration name mn deps className tys decls =
161typeInstanceDictionaryDeclaration name mn deps className tys decls =
161− rethrow (strMsg ("Error in type class " ++ show className ++ ":") <>) $ do
162+ rethrow (strMsg ("Error in type class instance " ++ show className ++ " " ++ unwords (map prettyPrintTypeAtom tys) ++ ":") <>) $ do
162 m <- get
163 m <- get
163
164
164 -- Lookup the type arguments and member types for the type class
165 -- Lookup the type arguments and member types for the type class