on master help sign in
HLint fixes
076fb55Neil Mitchell
gen/Lib.hs+1−1
@@ -100,7 +100,7 @@ instance Show CharSet where
100-- | Given we know the first argument are all true, can the second argument ever be False
100-- | Given we know the first argument are all true, can the second argument ever be False
101implies :: [CharSet] -> CharSet -> Bool
101implies :: [CharSet] -> CharSet -> Bool
102implies known x = all (fromCharSet x) poss
102implies known x = all (fromCharSet x) poss
103− where poss = filter (\c -> all (\k -> fromCharSet k c) known) chars
103+ where poss = filter (\c -> all (`fromCharSet` c) known) chars
104
104
105charSetC :: [CharSet] -> ([String], CharSet -> String)
105charSetC :: [CharSet] -> ([String], CharSet -> String)
106charSetC sets =
106charSetC sets =
gen/Parser.hs+4−4
@@ -12,8 +12,9 @@ data Out
12 | TagComment | TagOpen | TagClose | TagOpenClose
12 | TagComment | TagOpen | TagClose | TagOpenClose
13 deriving Show
13 deriving Show
14
14
15+is lower upper x = x >= lower && x <= upper
15−isName1 x = x == ':' || x == '_' || (x >= 'a' && x <= 'z') || (x >= 'A' && x <= 'Z')
16+isName1 x = x == ':' || x == '_' || is 'a' 'z' x || is 'A' 'Z' x
16−isName x = isName1 x || x == '-' || (x >= '0' && x <= '9')
17+isName x = isName1 x || x == '-' || is '0' '9' x
17isSpace x = x == ' ' || x == '\t' || x == '\r' || x == '\n'
18isSpace x = x == ' ' || x == '\t' || x == '\r' || x == '\n'
18
19
19whitespace = many $ match isSpace
20whitespace = many $ match isSpace
@@ -52,8 +53,7 @@ tag = do
52 let name_ = name `choice` abort "Missing tag name"
53 let name_ = name `choice` abort "Missing tag name"
53 choices
54 choices
54 [do lit "!--"
55 [do lit "!--"
55− many $ do
56− lit "-->" -- FIXME: Not correct!!!
56+ many $ lit "-->" -- FIXME: Not correct!!!
57 out TagComment
57 out TagComment
58 ,do lit "?"
58 ,do lit "?"
59 name_
59 name_