git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Adds specific error message when failing to import bind (#2527)

* Adds specific error message when failing to import bind * Adds markCode to bind mention in error message

commit45dd7d8d05ba1ba018fd5c78551917722a49c542 authorSimon Van Casteren <simon.van.casteren@gmail.com> dateTue 3 Jan 2017, 20:51 (10 years ago) parent9147725
1 file changed+2
src/Language/PureScript/Errors.hs+2
src/Language/PureScript/Errors.hs+2
@@ -498,6 +498,8 @@ prettyPrintSingleError (PPEOptions codeColor full level showDocs) e = flip evalS
498498 line $ "The type declaration for " <> markCode (showIdent nm) <> " should be followed by its definition."
499499 renderSimpleErrorMessage (RedefinedIdent name) =
500500 line $ "The value " <> markCode (showIdent name) <> " has been defined multiple times"
501+ renderSimpleErrorMessage (UnknownName name@(Qualified Nothing (IdentName (Ident "bind")))) =
502+ line $ "Unknown " <> printName name <> ". You're probably using do-notation, which the compiler replaces with calls to the " <> markCode "bind" <> " function. Please import " <> markCode "bind" <> " from module " <> markCode "Prelude"
501503 renderSimpleErrorMessage (UnknownName name) =
502504 line $ "Unknown " <> printName name
503505 renderSimpleErrorMessage (UnknownImport mn name) =