Skip to content

Commit cfa3db3

Browse files
committed
HLint inspired cleanups
1 parent d32355a commit cfa3db3

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Generate.hs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,9 @@ parseTest (stripPrefix "-- > " -> Just x) = platform $ toLexemes x
4949

5050
free p val x = Test p [(ctor v, v) | v <- vars] x
5151
where vars = nub $ sort [v | v@[c] <- x, isAlpha c]
52-
ctor v = if v < "x" then "" else if v `elem` val then "QFilePathValid" ++ show p else "QFilePath"
52+
ctor v | v < "x" = ""
53+
| v `elem` val = "QFilePathValid" ++ show p
54+
| otherwise = "QFilePath"
5355
parseTest _ = []
5456

5557

@@ -80,7 +82,7 @@ renderTest Test{..} = (body, code)
8082

8183
qualify :: PW -> String -> String
8284
qualify pw str
83-
| str `elem` fpops || (all isAlpha str && length str > 1 && not (str `elem` prelude)) = show pw ++ "." ++ str
85+
| str `elem` fpops || (all isAlpha str && length str > 1 && str `notElem` prelude) = show pw ++ "." ++ str
8486
| otherwise = str
8587
where
8688
prelude = ["elem","uncurry","snd","fst","not","null","if","then","else"

0 commit comments

Comments
 (0)