HLint inspired cleanups
authorNeil Mitchell <ndmitchell@gmail.com>
Tue, 2 May 2017 15:55:39 +0000 (16:55 +0100)
committerNeil Mitchell <ndmitchell@gmail.com>
Tue, 2 May 2017 15:55:39 +0000 (16:55 +0100)
Generate.hs

index 7fb218e..4bf94d2 100755 (executable)
@@ -49,7 +49,9 @@ parseTest (stripPrefix "-- > " -> Just x) = platform $ toLexemes x
 
         free p val x = Test p [(ctor v, v) | v <- vars] x
             where vars = nub $ sort [v | v@[c] <- x, isAlpha c]
-                  ctor v = if v < "x" then "" else if v `elem` val then "QFilePathValid" ++ show p else "QFilePath"
+                  ctor v | v < "x" = ""
+                         | v `elem` val = "QFilePathValid" ++ show p
+                         | otherwise = "QFilePath"
 parseTest _ = []
 
 
@@ -80,7 +82,7 @@ renderTest Test{..} = (body, code)
 
 qualify :: PW -> String -> String
 qualify pw str
-    | str `elem` fpops || (all isAlpha str && length str > 1 && not (str `elem` prelude)) = show pw ++ "." ++ str
+    | str `elem` fpops || (all isAlpha str && length str > 1 && str `notElem` prelude) = show pw ++ "." ++ str
     | otherwise = str
     where
         prelude = ["elem","uncurry","snd","fst","not","null","if","then","else"