[commit: packages/filepath] RyanGlScott-patch-1, master: HLint inspired cleanups (cfa3db3)
git at git.haskell.org
git at git.haskell.org
Thu Sep 13 14:50:44 UTC 2018
Repository : ssh://git@git.haskell.org/filepath
On branches: RyanGlScott-patch-1,master
Link : http://git.haskell.org/packages/filepath.git/commitdiff/cfa3db3bd8effc797a7c1d59f340bae53b96e961
>---------------------------------------------------------------
commit cfa3db3bd8effc797a7c1d59f340bae53b96e961
Author: Neil Mitchell <ndmitchell at gmail.com>
Date: Tue May 2 16:55:39 2017 +0100
HLint inspired cleanups
>---------------------------------------------------------------
cfa3db3bd8effc797a7c1d59f340bae53b96e961
Generate.hs | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/Generate.hs b/Generate.hs
index 7fb218e..4bf94d2 100755
--- a/Generate.hs
+++ b/Generate.hs
@@ -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"
More information about the ghc-commits
mailing list