diff options
Diffstat (limited to 'compiler/GHC/Utils')
-rw-r--r-- | compiler/GHC/Utils/Json.hs | 2 | ||||
-rw-r--r-- | compiler/GHC/Utils/Lexeme.hs | 18 |
2 files changed, 10 insertions, 10 deletions
diff --git a/compiler/GHC/Utils/Json.hs b/compiler/GHC/Utils/Json.hs index acccc88658..47f599c950 100644 --- a/compiler/GHC/Utils/Json.hs +++ b/compiler/GHC/Utils/Json.hs @@ -24,7 +24,7 @@ renderJSON :: JsonDoc -> SDoc renderJSON d = case d of JSNull -> text "null" - JSBool b -> text $ if b then "true" else "false" + JSBool b -> if b then text "true" else text "false" JSInt n -> ppr n JSString s -> doubleQuotes $ text $ escapeJsonString s JSArray as -> brackets $ pprList renderJSON as diff --git a/compiler/GHC/Utils/Lexeme.hs b/compiler/GHC/Utils/Lexeme.hs index f71bf1674a..ef7a076faf 100644 --- a/compiler/GHC/Utils/Lexeme.hs +++ b/compiler/GHC/Utils/Lexeme.hs @@ -67,17 +67,17 @@ isLexId cs = isLexConId cs || isLexVarId cs isLexSym cs = isLexConSym cs || isLexVarSym cs ------------- -isLexConId cs = case unconsFS cs of -- Prefix type or data constructors - Nothing -> False -- e.g. "Foo", "[]", "(,)" - Just (c, _) -> cs == fsLit "[]" || startsConId c +isLexConId cs = case unpackFS cs of -- Prefix type or data constructors + [] -> False -- e.g. "Foo", "[]", "(,)" + c:_ -> cs == fsLit "[]" || startsConId c -isLexVarId cs = case unconsFS cs of -- Ordinary prefix identifiers - Nothing -> False -- e.g. "x", "_x" - Just (c, _) -> startsVarId c +isLexVarId cs = case unpackFS cs of -- Ordinary prefix identifiers + [] -> False -- e.g. "x", "_x" + c:_ -> startsVarId c -isLexConSym cs = case unconsFS cs of -- Infix type or data constructors - Nothing -> False -- e.g. ":-:", ":", "->" - Just (c, _) -> cs == fsLit "->" || startsConSym c +isLexConSym cs = case unpackFS cs of -- Infix type or data constructors + [] -> False -- e.g. ":-:", ":", "->" + c:_ -> cs == fsLit "->" || startsConSym c isLexVarSym fs -- Infix identifiers e.g. "+" | fs == (fsLit "~R#") = True |