@@ -246,124 +246,3 @@ maybeYouWant prefix suggestions =
246 ++ "Maybe you want one of the following?\n"
246 ++ "Maybe you want one of the following?\n"
247 ++ concatMap ("\n "++) suggestions
247 ++ concatMap ("\n "++) suggestions
252− key .= (value :: String)
255−errorToJson :: LError -> Json.Value
256−errorToJson (A.A region err) =
257− Json.object (generals ++ specifics)
260− [ "category" .=. "canonicalization"
261− , "region" .= region
266− Var (VarError kind name varProblem) ->
270− ++ varProblemToJson varProblem
274− ArgMismatch name expected actual ->
275− [ "tag" .=. "alias-args"
276− , "name" .= Var.toString name
277− , "expected-args" .= expected
278− , "actual-args" .= actual
281− Recursive [(name, tvars, tipe)] ->
282− [ "tag" .=. "recursive-alias"
285− Recursive aliases ->
286− [ "tag" .=. "mutually-recursive-aliases"
289− Import moduleName importError ->
291− ModuleNotFound suggestions ->
292− [ "tag" .=. "unknown-import"
293− , "name" .= moduleName
294− , "suggestions" .= suggestions
296− ValueNotFound name suggestions ->
299− Export name suggestions ->
306−varProblemToJson :: VarProblem -> [Json.Pair]
307−varProblemToJson varProblem =
308− let details tag suggestions =
310− , "suggestions" .= suggestions
314− Ambiguous possibilities ->
315− details "ambiguous" possibilities
317− UnknownQualifier possibleModules ->
320− (map Module.nameToString possibleModules)
322− QualifiedUnknown possibilities ->
323− details "qualified-unknown" possibilities
325− ExposedUnknown closeExposed closeQualified ->
326− details "exposed-unknown" (closeExposed ++ closeQualified)
331−mutuallyRecursiveMessage :: String
332−mutuallyRecursiveMessage =
333− "The following type aliases are mutually recursive, forming an \
334− \infinite type. When you expand them, they just keep getting bigger:"
337−typeAliasErrorSegue :: String
338−typeAliasErrorSegue =
342−typeAliasErrorExplanation :: String
343−typeAliasErrorExplanation =
344− "It looks very similar, but the 'type' keyword creates a brand new type, \
345− \not just an alias for an existing one. This lets us avoid infinitely \
346− \expanding it during type inference."
350− :: (String, [String], Type.Type var)
351− -> D.Declaration' pk def var expr
357− :: (String, [String], Type.Type var)
358− -> D.Declaration' pk def var expr
360− D.Datatype n ts [(n,[t])]
363−indented :: [D.ValidDecl] -> Doc
365− P.vcat (map prty decls) <> P.text "\n"
367− prty decl = P.text "\n " <> pretty decl