on master help sign in
Merge pull request #960 from rtfeldman/backticks-over-single-quotes
54dae77Evan Czaplicki
src/CommandLineRouter.hs+2−2
@@ -26,10 +26,10 @@ attemptToRun command args =
26 case found of
26 case found of
27 Nothing ->
27 Nothing ->
28 hPutStrLn stderr $
28 hPutStrLn stderr $
29− "Could not find command '" ++ command ++ "'. Maybe there is a typo?\n\n\
29+ "Could not find command `" ++ command ++ "`. Maybe there is a typo?\n\n\
30 \Default commands include:\n\n"
30 \Default commands include:\n\n"
31 ++ availableCommands ++
31 ++ availableCommands ++
32− "\nWhen you try to run the command '" ++ command ++ "' we actually search for an\n\
32+ "\nWhen you try to run the command `" ++ command ++ "` we actually search for an\n\
33 \ executable named elm-" ++ command ++ ". Are you able to run elm-" ++ command ++ "?\n\
33 \ executable named elm-" ++ command ++ ". Are you able to run elm-" ++ command ++ "?\n\
34 \ Is it on your PATH?"
34 \ Is it on your PATH?"
35
35
src/Elm/Utils.hs+1−1
@@ -87,7 +87,7 @@ unwrappedRun command args =
87missingExe :: String -> CommandError
87missingExe :: String -> CommandError
88missingExe command =
88missingExe command =
89 MissingExe $
89 MissingExe $
90− "Could not find command '" ++ command ++ "'. Do you have it installed?\n\
90+ "Could not find command `" ++ command ++ "`. Do you have it installed?\n\
91 \ Can it be run from anywhere? Is it on your PATH?"
91 \ Can it be run from anywhere? Is it on your PATH?"
92
92
93
93
src/Generate/Cases.hs+2−2
@@ -258,5 +258,5 @@ matchMix vs branches def =
258
258
259noMatch :: String -> a
259noMatch :: String -> a
260noMatch name =
260noMatch name =
261− error $ "unexpected pattern in '" ++ name ++
261+ error $ "unexpected pattern in `" ++ name ++
262− "' function. Report a compiler issue to <https://github.com/elm-lang/Elm>."
262+ "` function. Report a compiler issue to <https://github.com/elm-lang/Elm>."
src/Generate/JavaScript/Port.hs+1−1
@@ -41,7 +41,7 @@ typeToString tipe =
41 JSString -> "a string"
41 JSString -> "a string"
42 JSArray -> "an array"
42 JSArray -> "an array"
43 JSObject fields ->
43 JSObject fields ->
44− "an object with fields '" ++ List.intercalate "', '" fields ++ "'"
44+ "an object with fields `" ++ List.intercalate "`, `" fields ++ "`"
45
45
46
46
47_Array :: String -> Expression ()
47_Array :: String -> Expression ()
src/Parse/Helpers.hs+1−1
@@ -101,7 +101,7 @@ makeVar firstChar =
101
101
102reserved :: String -> IParser String
102reserved :: String -> IParser String
103reserved word =
103reserved word =
104− expecting ("reserved word '" ++ word ++ "'") $
104+ expecting ("reserved word `" ++ word ++ "`") $
105 do string word
105 do string word
106 notFollowedBy innerVarChar
106 notFollowedBy innerVarChar
107 return word
107 return word
src/Parse/Module.hs+1−1
@@ -67,7 +67,7 @@ import' =
67 as' moduleName =
67 as' moduleName =
68 do try (whitespace >> reserved "as")
68 do try (whitespace >> reserved "as")
69 whitespace
69 whitespace
70− capVar <?> ("an alias for module '" ++ moduleName ++ "'")
70+ capVar <?> ("an alias for module `" ++ moduleName ++ "`")
71
71
72 exposing :: IParser (Var.Listing Var.Value)
72 exposing :: IParser (Var.Listing Var.Value)
73 exposing =
73 exposing =
src/Reporting/Error/Canonicalize.hs+7−7
@@ -139,7 +139,7 @@ toReport :: P.Dealiaser -> Error -> Report.Report
139toReport dealiaser err =
139toReport dealiaser err =
140 case err of
140 case err of
141 Var (VarError kind name problem suggestions) ->
141 Var (VarError kind name problem suggestions) ->
142− let var = kind ++ " '" ++ name ++ "'"
142+ let var = kind ++ " `" ++ name ++ "`"
143 in
143 in
144 case problem of
144 case problem of
145 Ambiguous ->
145 Ambiguous ->
@@ -149,12 +149,12 @@ toReport dealiaser err =
149
149
150 UnknownQualifier qualifier ->
150 UnknownQualifier qualifier ->
151 namingError
151 namingError
152− ("Cannot find " ++ var ++ ", qualifier '" ++ qualifier ++ "' is not in scope.")
152+ ("Cannot find " ++ var ++ ", qualifier `" ++ qualifier ++ "` is not in scope.")
153 (maybeYouWant suggestions)
153 (maybeYouWant suggestions)
154
154
155 QualifiedUnknown qualifier ->
155 QualifiedUnknown qualifier ->
156 namingError
156 namingError
157− ("Cannot find " ++ var ++ ", module '" ++ qualifier ++ "' does not expose that value.")
157+ ("Cannot find " ++ var ++ ", module `" ++ qualifier ++ "` does not expose that value.")
158 (maybeYouWant suggestions)
158 (maybeYouWant suggestions)
159
159
160 ExposedUnknown ->
160 ExposedUnknown ->
@@ -200,17 +200,17 @@ toReport dealiaser err =
200 case importError of
200 case importError of
201 ModuleNotFound suggestions ->
201 ModuleNotFound suggestions ->
202 namingError
202 namingError
203− ("Could not find a module named '" ++ moduleName ++ "'")
203+ ("Could not find a module named `" ++ moduleName ++ "`")
204 (maybeYouWant (map Module.nameToString suggestions))
204 (maybeYouWant (map Module.nameToString suggestions))
205
205
206 ValueNotFound value suggestions ->
206 ValueNotFound value suggestions ->
207 namingError
207 namingError
208− ("Module '" ++ moduleName ++ "' does not expose '" ++ value ++ "'")
208+ ("Module `" ++ moduleName ++ "` does not expose `" ++ value ++ "`")
209 (maybeYouWant suggestions)
209 (maybeYouWant suggestions)
210
210
211 Export name suggestions ->
211 Export name suggestions ->
212 namingError
212 namingError
213− ("Could not export '" ++ name ++ "' which is not defined in this module.")
213+ ("Could not export `" ++ name ++ "` which is not defined in this module.")
214 (maybeYouWant suggestions)
214 (maybeYouWant suggestions)
215
215
216 Port (PortError name isInbound _rootType localType maybeMessage) ->
216 Port (PortError name isInbound _rootType localType maybeMessage) ->
@@ -220,7 +220,7 @@ toReport dealiaser err =
220
220
221 preHint =
221 preHint =
222 "Trying to send " ++ maybe "an unsupported type" id maybeMessage
222 "Trying to send " ++ maybe "an unsupported type" id maybeMessage
223− ++ " through " ++ boundPort ++ " '" ++ name ++ "'"
223+ ++ " through " ++ boundPort ++ " `" ++ name ++ "`"
224
224
225 postHint =
225 postHint =
226 "The specific unsupported type is:\n\n"
226 "The specific unsupported type is:\n\n"
src/Reporting/Error/Syntax.hs+14−14
@@ -50,7 +50,7 @@ toReport dealiaser err =
50 TypeWithoutDefinition valueName ->
50 TypeWithoutDefinition valueName ->
51 Report.simple
51 Report.simple
52 "MISSING DEFINITION"
52 "MISSING DEFINITION"
53− ("There is a type annotation for '" ++ valueName ++ "' but there"
53+ ("There is a type annotation for `" ++ valueName ++ "` but there"
54 ++ "is no corresponding definition!"
54 ++ "is no corresponding definition!"
55 )
55 )
56 ("Directly below the type annotation, put a definition like:\n\n"
56 ("Directly below the type annotation, put a definition like:\n\n"
@@ -60,7 +60,7 @@ toReport dealiaser err =
60 PortWithoutAnnotation portName ->
60 PortWithoutAnnotation portName ->
61 Report.simple
61 Report.simple
62 "PORT ERROR"
62 "PORT ERROR"
63− ("Port '" ++ portName ++ "' does not have a type annotation!")
63+ ("Port `" ++ portName ++ "` does not have a type annotation!")
64 ("Directly above the port definition, I need something like this:\n\n"
64 ("Directly above the port definition, I need something like this:\n\n"
65 ++ " port " ++ portName ++ " : Signal Int"
65 ++ " port " ++ portName ++ " : Signal Int"
66 )
66 )
@@ -78,30 +78,30 @@ toReport dealiaser err =
78 DuplicateValueDeclaration name ->
78 DuplicateValueDeclaration name ->
79 Report.simple
79 Report.simple
80 "DUPLICATE DEFINITION"
80 "DUPLICATE DEFINITION"
81− ("Naming multiple top-level values '" ++ name ++ "' makes things\n"
81+ ("Naming multiple top-level values `" ++ name ++ "` makes things\n"
82− ++ "ambiguous. When you say '" ++ name ++ "' which one do you want?"
82+ ++ "ambiguous. When you say `" ++ name ++ "` which one do you want?"
83 )
83 )
84− ("Find all the top-level values named '" ++ name ++ "' and\n"
84+ ("Find all the top-level values named `" ++ name ++ "` and\n"
85 ++ "do some renaming. Make sure the names are distinct!"
85 ++ "do some renaming. Make sure the names are distinct!"
86 )
86 )
87
87
88 DuplicateTypeDeclaration name ->
88 DuplicateTypeDeclaration name ->
89 Report.simple
89 Report.simple
90 "DUPLICATE DEFINITION"
90 "DUPLICATE DEFINITION"
91− ("Naming multiple types '" ++ name ++ "' makes things ambiguous\n"
91+ ("Naming multiple types `" ++ name ++ "` makes things ambiguous\n"
92− ++ "When you say '" ++ name ++ "' which one do you want?"
92+ ++ "When you say `" ++ name ++ "` which one do you want?"
93 )
93 )
94− ("Find all the types named '" ++ name ++ "' and\n"
94+ ("Find all the types named `" ++ name ++ "` and\n"
95 ++ "do some renaming. Make sure the names are distinct!"
95 ++ "do some renaming. Make sure the names are distinct!"
96 )
96 )
97
97
98 DuplicateDefinition name ->
98 DuplicateDefinition name ->
99 Report.simple
99 Report.simple
100 "DUPLICATE DEFINITION"
100 "DUPLICATE DEFINITION"
101− ("Naming multiple values '" ++ name ++ "' in a single let-expression makes\n"
101+ ("Naming multiple values `" ++ name ++ "` in a single let-expression makes\n"
102− ++ "things ambiguous. When you say '" ++ name ++ "' which one do you want?"
102+ ++ "things ambiguous. When you say `" ++ name ++ "` which one do you want?"
103 )
103 )
104− ("Find all the values named '" ++ name ++ "' in this let-expression and\n"
104+ ("Find all the values named `" ++ name ++ "` in this let-expression and\n"
105 ++ "do some renaming. Make sure the names are distinct!"
105 ++ "do some renaming. Make sure the names are distinct!"
106 )
106 )
107
107
@@ -135,13 +135,13 @@ unboundTypeVars :: String -> String -> [String] -> String -> Report.Report
135unboundTypeVars typeName tvar tvars revisedDeclaration =
135unboundTypeVars typeName tvar tvars revisedDeclaration =
136 Report.simple
136 Report.simple
137 "UNBOUND TYPE VARS"
137 "UNBOUND TYPE VARS"
138− ( "Not all type variables in '" ++ typeName ++ "' are listed, making sneaky\n"
138+ ( "Not all type variables in `" ++ typeName ++ "` are listed, making sneaky\n"
139 ++ "type errors possible. Unbound type variables include: "
139 ++ "type errors possible. Unbound type variables include: "
140 ++ List.intercalate ", " (tvar:tvars)
140 ++ List.intercalate ", " (tvar:tvars)
141 )
141 )
142 ( "You probably want this definition instead:\n"
142 ( "You probably want this definition instead:\n"
143 ++ concatMap ("\n "++) (lines revisedDeclaration) ++ "\n\n"
143 ++ concatMap ("\n "++) (lines revisedDeclaration) ++ "\n\n"
144− ++ "Here's why. Imagine one '" ++ typeName ++ "' where '" ++ tvar ++ "' is an Int and\n"
144+ ++ "Here's why. Imagine one `" ++ typeName ++ "` where `" ++ tvar ++ "` is an Int and\n"
145 ++ "another where it is a Bool. When we explicitly list the type variables, type\n"
145 ++ "another where it is a Bool. When we explicitly list the type variables, type\n"
146 ++ "checker can see that they are actually different types."
146 ++ "checker can see that they are actually different types."
147 )
147 )
@@ -202,7 +202,7 @@ parseErrorReport messages =
202 [msg] ->
202 [msg] ->
203 case unkeyword msg of
203 case unkeyword msg of
204 Just kwd ->
204 Just kwd ->
205− "It looks like the keyword '" ++ kwd ++ "' is being used as a variable.\n"
205+ "It looks like the keyword `" ++ kwd ++ "` is being used as a variable.\n"
206 ++ "Try renaming it to something else."
206 ++ "Try renaming it to something else."
207 Nothing ->
207 Nothing ->
208 msg
208 msg
src/Reporting/Error/Type.hs+4−4
@@ -90,14 +90,14 @@ toReport dealiaser err =
90 P.pretty dealiaser False tipe
90 P.pretty dealiaser False tipe
91 in
91 in
92 Report.simple "INFINITE TYPE"
92 Report.simple "INFINITE TYPE"
93− ( "I am inferring weird self-referential type for '" ++ name ++ "'"
93+ ( "I am inferring weird self-referential type for `" ++ name ++ "`"
94 )
94 )
95 ( "The bit of the type that is self-referential looks like this:\n\n"
95 ( "The bit of the type that is self-referential looks like this:\n\n"
96 ++ P.render (P.nest 4 (prettyVar <+> P.equals <+> prettyType))
96 ++ P.render (P.nest 4 (prettyVar <+> P.equals <+> prettyType))
97− ++ "\n\nThe cause is often that the usage of '" ++ name ++ "' is flipped around.\n\n"
97+ ++ "\n\nThe cause is often that the usage of `" ++ name ++ "` is flipped around.\n\n"
98 ++ "Maybe you are inserting a data structure into an element? Maybe you are giving\n"
98 ++ "Maybe you are inserting a data structure into an element? Maybe you are giving\n"
99 ++ "a function to an argument? Either way, something is probably backwards!\n\n"
99 ++ "a function to an argument? Either way, something is probably backwards!\n\n"
100− ++ "Try breaking the code related to '" ++ name ++ "' into smaller pieces.\n"
100+ ++ "Try breaking the code related to `" ++ name ++ "` into smaller pieces.\n"
101 ++ "Give each piece a name and try to write down its type."
101 ++ "Give each piece a name and try to write down its type."
102 )
102 )
103
103
@@ -190,7 +190,7 @@ hintToString hint =
190
190
191 BadTypeAnnotation name ->
191 BadTypeAnnotation name ->
192 ( Nothing
192 ( Nothing
193− , "The type annotation for '" ++ name ++ "' does not match its definition."
193+ , "The type annotation for `" ++ name ++ "` does not match its definition."
194 )
194 )
195
195
196
196
src/Reporting/Warning.hs+2−2
@@ -39,13 +39,13 @@ toReport dealiaser warning =
39 UnusedImport moduleName ->
39 UnusedImport moduleName ->
40 Report.simple
40 Report.simple
41 "unused import"
41 "unused import"
42− ("Module '" ++ Module.nameToString moduleName ++ "' is unused.")
42+ ("Module `" ++ Module.nameToString moduleName ++ "` is unused.")
43 ""
43 ""
44
44
45 MissingTypeAnnotation name inferredType ->
45 MissingTypeAnnotation name inferredType ->
46 Report.simple
46 Report.simple
47 "missing type annotation"
47 "missing type annotation"
48− ("Top-level value '" ++ name ++ "' does not have a type annotation.")
48+ ("Top-level value `" ++ name ++ "` does not have a type annotation.")
49 ( "The type annotation you want looks something like this:\n\n"
49 ( "The type annotation you want looks something like this:\n\n"
50 ++ P.render (P.nest 4 typeDoc)
50 ++ P.render (P.nest 4 typeDoc)
51 )
51 )
src/Type/Environment.hs+3−3
@@ -117,7 +117,7 @@ get :: Environment -> (Environment -> Map.Map String a) -> String -> a
117get env subDict key =
117get env subDict key =
118 Map.findWithDefault (error msg) key (subDict env)
118 Map.findWithDefault (error msg) key (subDict env)
119 where
119 where
120− msg = "Could not find type constructor '" ++ key ++ "' while checking types."
120+ msg = "Could not find type constructor `" ++ key ++ "` while checking types."
121
121
122
122
123freshDataScheme
123freshDataScheme
@@ -210,8 +210,8 @@ instantiatorHelp env aliasVars sourceType =
210 Just t -> return t
210 Just t -> return t
211 Nothing ->
211 Nothing ->
212 error $
212 error $
213− "Could not find type constructor '" ++
213+ "Could not find type constructor `" ++
214− V.toString name ++ "' while checking types."
214+ V.toString name ++ "` while checking types."
215
215
216 T.App t ts ->
216 T.App t ts ->
217 do t' <- go t
217 do t' <- go t
src/Type/Solve.hs+1−1
@@ -167,7 +167,7 @@ actuallySolve constraint =
167 Nothing ->
167 Nothing ->
168 if List.isPrefixOf "Native." name
168 if List.isPrefixOf "Native." name
169 then liftIO (variable Flexible)
169 then liftIO (variable Flexible)
170− else error ("Could not find '" ++ name ++ "' when solving type constraints.")
170+ else error ("Could not find `" ++ name ++ "` when solving type constraints.")
171
171
172 t <- TS.flatten term
172 t <- TS.flatten term
173 unify Error.None region freshCopy t
173 unify Error.None region freshCopy t
src/Type/Unify.hs+2−2
@@ -167,7 +167,7 @@ actuallyUnify variable1 variable2 = do
167 let v = render (pretty Never var)
167 let v = render (pretty Never var)
168 in
168 in
169 typeError variable1 variable2 $ Error.PreNote $
169 typeError variable1 variable2 $ Error.PreNote $
170− "Could not unify rigid type variable '" ++ v ++ "'. The problem probably\n"
170+ "Could not unify rigid type variable `" ++ v ++ "`. The problem probably\n"
171 ++ "relates to the type variable being shared between two type annotations.\n"
171 ++ "relates to the type variable being shared between two type annotations.\n"
172 ++ "Try commenting out some type annotations and see what happens."
172 ++ "Try commenting out some type annotations and see what happens."
173
173
@@ -356,7 +356,7 @@ fieldMismatchError missingFields =
356 case Map.keys missingFields of
356 case Map.keys missingFields of
357 [] -> ""
357 [] -> ""
358 [key] ->
358 [key] ->
359− "Looks like a record is missing the field '" ++ key ++ "'"
359+ "Looks like a record is missing the field `" ++ key ++ "`"
360 keys ->
360 keys ->
361 "Looks like a record is missing fields "
361 "Looks like a record is missing fields "
362 ++ List.intercalate ", " (init keys) ++ ", and " ++ last keys
362 ++ List.intercalate ", " (init keys) ++ ", and " ++ last keys