Report generated by HLint v1.8.9 - a tool to suggest improvements to your Haskell code.
src/Printer.hs:306:33: Warning: Redundant $
Found
Found
"" : (foldl add_to_line [] $ words s)Why not
"" : foldl add_to_line [] (words s)
src/Printer.hs:308:32: Warning: Redundant bracket
Found
Found
(a : d)Why not
a : d
src/IsoDate.hs:173:20: Error: Reduce duplication
Found
Found
d <- day _ <- mySpaces h <- hour _ <- char ':' m <- minute _ <- char ':' s <- secondWhy not
Combine with src/IsoDate.hs:191:23
src/IsoDate.hs:145:20: Warning: Use .
Found
Found
foldr (<|>) (return []) (map (\ x -> try $ count x p) (reverse [1 .. m]))Why not
foldr ((<|>) . (\ x -> try $ count x p)) (return []) (reverse [1 .. m])
src/IsoDate.hs:274:23: Warning: Redundant bracket
Found
Found
[(diff . yfn)]Why not
[diff . yfn]
src/IsoDate.hs:311:39: Warning: Redundant bracket
Found
Found
10 ^ (picoExp - digsExp) * (read digs)Why not
10 ^ (picoExp - digsExp) * read digs
src/IsoDate.hs:312:48: Warning: Redundant $
Found
Found
Just $ fracWhy not
Just frac
src/IsoDate.hs:370:33: Warning: Redundant bracket
Found
Found
if (unset x) then 0 else xWhy not
if unset x then 0 else x
src/IsoDate.hs:432:25: Warning: Redundant $
Found
Found
intToMonth $ (read mn :: Int)Why not
intToMonth (read mn :: Int)
src/IsoDate.hs:546:78: Warning: Use string literal
Found
Found
[' ']Why not
" "
src/IsoDate.hs:575:18: Warning: Redundant $
Found
Found
fromMaybe id t $ edWhy not
fromMaybe id t ed
src/IsoDate.hs:582:22: Warning: Redundant $
Found
Found
unsetTime $ edWhy not
unsetTime ed
src/IsoDate.hs:597:8: Warning: Redundant $
Found
Found
caseString "today" >> (return $ resetCalendar now)Why not
caseString "today" >> return (resetCalendar now)
src/IsoDate.hs:598:8: Warning: Redundant $
Found
Found
caseString "yesterday" >> (return $ oneDay `subtractFromCal` now)Why not
caseString "yesterday" >> return (oneDay `subtractFromCal` now)
src/IsoDate.hs:616:23: Warning: Redundant $
Found
Found
(try $ caseString "ago" >> return ((-1), now)) <|> do m <- beforeMod <|> afterMod _ <- space d <- englishDate now <|> fst `fmap` englishLast now <|> unsafeToCalendarTime `fmap` iso8601DateTime (ctTZ now) return (m, d)Why not
try (caseString "ago" >> return ((-1), now)) <|> do m <- beforeMod <|> afterMod _ <- space d <- englishDate now <|> fst `fmap` englishLast now <|> unsafeToCalendarTime `fmap` iso8601DateTime (ctTZ now) return (m, d)
src/IsoDate.hs:616:57: Warning: Redundant bracket
Found
Found
((-1), now)Why not
(-1, now)
src/IsoDate.hs:626:23: Warning: Redundant bracket
Found
Found
(caseStrings ["after", "since"]) >> return 1Why not
caseStrings ["after", "since"] >> return 1
src/IsoDate.hs:642:16: Warning: Redundant bracket
Found
Found
(unsafeToCalendarTime `fmap` iso8601DateTime (ctTZ now) <|> englishDateTime now)Why not
unsafeToCalendarTime `fmap` iso8601DateTime (ctTZ now) <|> englishDateTime now
src/IsoDate.hs:722:18: Warning: Redundant $
Found
Found
caseString "score" >> (return $ TimeDiff 20 0 0 0 0 0 0)Why not
caseString "score" >> return (TimeDiff 20 0 0 0 0 0 0)
src/IsoDate.hs:723:18: Warning: Redundant $
Found
Found
caseString "year" >> (return $ TimeDiff 1 0 0 0 0 0 0)Why not
caseString "year" >> return (TimeDiff 1 0 0 0 0 0 0)
src/IsoDate.hs:724:18: Warning: Redundant $
Found
Found
caseString "month" >> (return $ TimeDiff 0 1 0 0 0 0 0)Why not
caseString "month" >> return (TimeDiff 0 1 0 0 0 0 0)
src/IsoDate.hs:725:18: Warning: Redundant $
Found
Found
caseString "fortnight" >> (return $ TimeDiff 0 0 14 0 0 0 0)Why not
caseString "fortnight" >> return (TimeDiff 0 0 14 0 0 0 0)
src/IsoDate.hs:726:18: Warning: Redundant $
Found
Found
caseString "week" >> (return $ TimeDiff 0 0 7 0 0 0 0)Why not
caseString "week" >> return (TimeDiff 0 0 7 0 0 0 0)
src/IsoDate.hs:727:18: Warning: Redundant $
Found
Found
caseString "day" >> (return $ TimeDiff 0 0 1 0 0 0 0)Why not
caseString "day" >> return (TimeDiff 0 0 1 0 0 0 0)
src/IsoDate.hs:728:18: Warning: Redundant $
Found
Found
caseString "hour" >> (return $ TimeDiff 0 0 0 1 0 0 0)Why not
caseString "hour" >> return (TimeDiff 0 0 0 1 0 0 0)
src/IsoDate.hs:729:18: Warning: Redundant $
Found
Found
caseString "minute" >> (return $ TimeDiff 0 0 0 0 1 0 0)Why not
caseString "minute" >> return (TimeDiff 0 0 0 0 1 0 0)
src/IsoDate.hs:730:18: Warning: Redundant $
Found
Found
caseString "second" >> (return $ TimeDiff 0 0 0 0 0 1 0)Why not
caseString "second" >> return (TimeDiff 0 0 0 0 0 1 0)
src/IsoDate.hs:817:55: Warning: Redundant bracket
Found
Found
a7 * (toInteger m)Why not
a7 * toInteger m
src/URL.hs:2:1: Error: Unused LANGUAGE pragma
Found
Found
{-# LANGUAGE CPP, ForeignFunctionInterface #-}
Why not{-# LANGUAGE CPP #-}
src/URL.hs:33:1: Error: Use fewer imports
Found
Found
import Progress (debugMessage) import Progress (debugFail)Why not
import Progress (debugMessage, debugFail)
src/URL.hs:154:45: Warning: Redundant bracket
Found
Found
return . (Map.lookup u)Why not
return . Map.lookup u
src/URL.hs:184:29: Warning: Redundant bracket
Found
Found
((\ imp_funny_name -> imp_funny_name ("src/URL.hs", 184, "14:10:57", "20 May 2012")) Bug_._bug) $ "Possible bug in URL.checkWaitToStart " ++ uWhy not
(\ imp_funny_name -> imp_funny_name ("src/URL.hs", 184, "14:10:57", "20 May 2012")) Bug_._bug $ "Possible bug in URL.checkWaitToStart " ++ u
src/URL.hs:200:33: Warning: Redundant bracket
Found
Found
return . (Map.insertWith fn u v)Why not
return . Map.insertWith fn u v
src/URL.hs:210:31: Warning: Redundant $
Found
Found
liftIO $ waitNextUrl'Why not
liftIO waitNextUrl'
src/URL.hs:221:44: Warning: Redundant bracket
Found
Found
((\ imp_funny_name -> imp_funny_name ("src/URL.hs", 221, "14:10:57", "20 May 2012")) Bug_._bug) $ "Possible bug in URL.waitNextUrl: " ++ uWhy not
(\ imp_funny_name -> imp_funny_name ("src/URL.hs", 221, "14:10:57", "20 May 2012")) Bug_._bug $ "Possible bug in URL.waitNextUrl: " ++ u
src/URL.hs:230:44: Warning: Redundant bracket
Found
Found
((\ imp_funny_name -> imp_funny_name ("src/URL.hs", 230, "14:10:57", "20 May 2012")) Bug_._bug) $ "Another possible bug in URL.waitNextUrl: " ++ u ++ " " ++ eWhy not
(\ imp_funny_name -> imp_funny_name ("src/URL.hs", 230, "14:10:57", "20 May 2012")) Bug_._bug $ "Another possible bug in URL.waitNextUrl: " ++ u ++ " " ++ e
src/URL.hs:238:35: Warning: Redundant bracket
Found
Found
return . (Map.lookup u)Why not
return . Map.lookup u
src/URL.hs:245:48: Warning: Redundant bracket
Found
Found
return . (Map.lookup u)Why not
return . Map.lookup u
src/URL.hs:249:55: Warning: Redundant bracket
Found
Found
return . (Map.delete u)Why not
return . Map.delete u
src/DateTester.hs:72:1: Warning: Parse error
Error message
Error message
Parse error: ;Code
Left err -> shows err "" Right x -> show x ++ "\n" ++ show (m x now) >
src/ByteStringUtils.hs:155:5: Error: Use elem
Found
Found
w == 10 || w == 13Why not
(w `elem` [10, 13])
src/ByteStringUtils.hs:237:32: Warning: Redundant bracket
Found
Found
(fromIntegral x) + (rotateL h 8)Why not
fromIntegral x + (rotateL h 8)
src/ByteStringUtils.hs:237:32: Warning: Redundant bracket
Found
Found
(fromIntegral x) + (rotateL h 8)Why not
(fromIntegral x) + rotateL h 8
src/ByteStringUtils.hs:465:25: Error: Redundant bracket
Found
Found
(B.ByteString)Why not
B.ByteString
src/ByteStringUtils.hs:528:18: Warning: Avoid lambda
Found
Found
\ w -> w < 128Why not
(< 128)
src/ByteStringUtils.hs:541:16: Warning: Redundant bracket
Found
Found
B.pack . (map (fromIntegral . ord))Why not
B.pack . map (fromIntegral . ord)
src/Exec.hs:18:1: Error: Unused LANGUAGE pragma
Found
Found
{-# LANGUAGE CPP, ForeignFunctionInterface, DeriveDataTypeable #-}
Why not{-# LANGUAGE CPP, DeriveDataTypeable #-}
src/Exec.hs:38:1: Error: Use fewer imports
Found
Found
import Control.Exception.Extensible (bracket) import Control.Exception.Extensible (bracketOnError, Exception(..), SomeException(..))Why not
import Control.Exception.Extensible (bracket, bracketOnError, Exception(..), SomeException(..))
src/Exec.hs:41:1: Error: Use fewer imports
Found
Found
import System.IO (stdin) import System.IO (IOMode(..), openBinaryFile, stdout)Why not
import System.IO (stdin, IOMode(..), openBinaryFile, stdout)
src/Exec.hs:104:5: Error: Eta reduce
Found
Found
toException e = SomeException eWhy not
toException = SomeException
src/Exec.hs:126:7: Error: Redundant bracket
Found
Found
(terminateProcess)Why not
terminateProcess
src/Exec.hs:127:7: Error: Redundant bracket
Found
Found
(waitForProcess)Why not
waitForProcess
src/Lcs.hs:96:17: Warning: Redundant bracket
Found
Found
(a ! from) : (getSlice a (from + 1) to)Why not
(a ! from) : getSlice a (from + 1) to
src/Lcs.hs:126:22: Warning: Redundant bracket
Found
Found
case Map.lookup h hm of Just (_, False, _, _) -> Nothing Just (_, _, False, _) -> Nothing Just (False, True, True, _) -> Just (i, h) Just (True, True, True, _) -> Just (i, markColl) Nothing -> ((\ imp_funny_name -> imp_funny_name ("src/Lcs.hs", 131, "14:10:57", "20 May 2012")) Bug_._impossible)Why not
case Map.lookup h hm of Just (_, False, _, _) -> Nothing Just (_, _, False, _) -> Nothing Just (False, True, True, _) -> Just (i, h) Just (True, True, True, _) -> Just (i, markColl) Nothing -> (\ imp_funny_name -> imp_funny_name ("src/Lcs.hs", 131, "14:10:57", "20 May 2012")) Bug_._impossible
src/Lcs.hs:225:33: Warning: Redundant bracket
Found
Found
(xmid, ymid, (c * 2 - 1))Why not
(xmid, ymid, c * 2 - 1)
src/Lcs.hs:312:17: Warning: Redundant bracket
Found
Found
(aLen p_a) + 1Why not
aLen p_a + 1
src/Lcs.hs:355:25: Warning: Use guards
Found
Found
corr0 = if i0 > (i + 1) then noline else if j0 - j > 2 then i0 else corrWhy not
corr0 | i0 > (i + 1) = noline | j0 - j > 2 = i0 | otherwise = corr
src/Lcs.hs:357:25: Warning: Use guards
Found
Found
blank0 = if i0 > i + 1 then noline else if p_a ! (i0 - 1) == B.empty then i0 else blankWhy not
blank0 | i0 > i + 1 = noline | p_a ! (i0 - 1) == B.empty = i0 | otherwise = blank
src/Lcs.hs:452:11: Warning: Use fmap
Found
Found
getBounds a >>= return . sndWhy not
fmap snd (getBounds a)
src/Lcs.hs:464:17: Warning: Redundant bracket
Found
Found
(b ! (from + 1)) : (getInsert b (from + 1) to)Why not
(b ! (from + 1)) : getInsert b (from + 1) to
src/Lcs.hs:468:17: Warning: Redundant bracket
Found
Found
(a ! (from + 1)) : (getDelete a (from + 1) to)Why not
(a ! (from + 1)) : getDelete a (from + 1) to
src/Lcs.hs:480:14: Warning: Redundant bracket
Found
Found
(ia', ia, ib', ib) : (createP c_a c_b ia' ib')Why not
(ia', ia, ib', ib) : createP c_a c_b ia' ib'
src/Progress.hs:122:5: Warning: Redundant $
Found
Found
setProgressData k $ ProgressData{sofar = 0, latest = Nothing, total = Nothing}Why not
setProgressData k ProgressData{sofar = 0, latest = Nothing, total = Nothing}
src/Progress.hs:134:32: Warning: Use second
Found
Found
\ (a, m) -> (a, delete k m)Why not
Control.Arrow.second (delete k)
src/Progress.hs:135:38: Warning: Redundant bracket
Found
Found
"Done " ++ (map toLower k)Why not
"Done " ++ map toLower k
src/Progress.hs:249:35: Error: Use putStr
Found
Found
hPutStr stdoutWhy not
putStr
src/Progress.hs:250:22: Error: Use unless
Found
Found
when (not $ null s)Why not
unless (null s)
src/Progress.hs:255:1: Error: Eta reduce
Found
Found
setProgressMode m = writeIORef _progressMode mWhy not
setProgressMode = writeIORef _progressMode
src/Progress.hs:280:51: Warning: Use second
Found
Found
\ (a, m) -> (a, insert k p m)Why not
Control.Arrow.second (insert k p)
src/SHA1.hs:179:40: Warning: Redundant bracket
Found
Found
(complement x) .&. zWhy not
complement x .&. z
src/Crypt/SHA256.hs:27:28: Error: Use replicate
Found
Found
take 64 $ repeat 'x'Why not
replicate 64 'x'
src/Darcs/Compat.hs:15:1: Error: Use fewer imports
Found
Found
import Foreign.C.String (peekCString) import Foreign.C.String (CString, withCString)Why not
import Foreign.C.String (peekCString, CString, withCString)
src/Darcs/RepoPath.hs:146:15: Warning: Use bracket_
Found
Found
bracket (setCurrentDirectory dir) (const $ setCurrentDirectory $ toFilePath here) (const getCurrentDirectory)Why not
Control.Exception.bracket_ (setCurrentDirectory dir) (setCurrentDirectory $ toFilePath here) getCurrentDirectory
src/Darcs/Ssh.hs:1:1: Error: Unused LANGUAGE pragma
Found
Found
{-# LANGUAGE CPP, ForeignFunctionInterface #-}
Why not{-# LANGUAGE CPP #-}
src/Darcs/Ssh.hs:86:24: Error: Use unless
Found
Found
if l == "Hello user, I am darcs transfer mode" then return () else debugFail "Couldn't start darcs transfer-mode on server"Why not
(Control.Monad.unless (l == "Hello user, I am darcs transfer mode") $ debugFail "Couldn't start darcs transfer-mode on server")
src/Darcs/Ssh.hs:97:53: Warning: Redundant $
Found
Found
unlines $ ["NOTE: the server may be running a version of darcs prior to 2.0.0.", "", "Installing darcs 2 on the server will speed up ssh-based commands."]Why not
unlines ["NOTE: the server may be running a version of darcs prior to 2.0.0.", "", "Installing darcs 2 on the server will speed up ssh-based commands."]
src/Darcs/Ssh.hs:108:20: Warning: Redundant bracket
Found
Found
"Severing ssh failed connection to " ++ (sshUhost x)Why not
"Severing ssh failed connection to " ++ sshUhost x
src/Darcs/Ssh.hs:149:1: Warning: Use view patterns
Found
Found
copySSH remote dest to | rdarcs <- remoteDarcs remote = do debugMessage $ "copySSH file: " ++ urlOf dest withSSHConnection rdarcs dest (\ c -> grabSSH dest c >>= B.writeFile to) $ do let u = escape_dollar $ urlOf dest (scp, args) <- getSSH SCP r <- exec scp (args ++ [u, to]) (AsIs, AsIs, AsIs) when (r /= ExitSuccess) $ debugFail $ "(scp) failed to fetch: " ++ u where escape_dollar :: String -> String escape_dollar = concatMap tr where tr '$' = "\\$" tr c = [c]Why not
copySSH (remoteDarcs -> rdarcs) dest to = do debugMessage $ "copySSH file: " ++ urlOf dest withSSHConnection rdarcs dest (\ c -> grabSSH dest c >>= B.writeFile to) $ do let u = escape_dollar $ urlOf dest (scp, args) <- getSSH SCP r <- exec scp (args ++ [u, to]) (AsIs, AsIs, AsIs) when (r /= ExitSuccess) $ debugFail $ "(scp) failed to fetch: " ++ u where escape_dollar :: String -> String escape_dollar = concatMap tr where tr '$' = "\\$" tr c = [c]
src/Darcs/Global.hs:66:1: Error: Use fewer imports
Found
Found
import Data.IORef (IORef, newIORef, readIORef, writeIORef) import Data.IORef (modifyIORef)Why not
import Data.IORef (IORef, newIORef, readIORef, writeIORef, modifyIORef)
src/Darcs/Global.hs:115:13: Warning: Redundant $
Found
Found
hPutStrLn stderr $ "Exception thrown by an atexit registered action:"Why not
hPutStrLn stderr "Exception thrown by an atexit registered action:"
src/Darcs/Email.hs:60:53: Warning: Redundant bracket
Found
Found
(ord c) > 127Why not
ord c > 127
src/Darcs/Email.hs:109:10: Error: Use notElem
Found
Found
not (c `elem` ['?', '=', '_'])Why not
notElem c ['?', '=', '_']
src/Darcs/Email.hs:109:24: Warning: Use string literal
Found
Found
['?', '=', '_']Why not
"?=_"
src/Darcs/Email.hs:132:24: Warning: Redundant bracket
Found
Found
case B.head ps of c | c == newline -> do poke (buf `plusPtr` bufi) newline encode ps' qlineMax buf (bufi + 1) | n == 0 && B.length ps > 1 -> do poke (buf `plusPtr` bufi) equals poke (buf `plusPtr` (bufi + 1)) newline encode ps qlineMax buf (bufi + 2) | (c == tab || c == space) -> if B.null ps' || B.head ps' == newline then do poke (buf `plusPtr` bufi) c poke (buf `plusPtr` (bufi + 1)) equals poke (buf `plusPtr` (bufi + 2)) newline encode ps' qlineMax buf (bufi + 3) else do poke (buf `plusPtr` bufi) c encode ps' (n - 1) buf (bufi + 1) | (c >= bang && c /= equals && c <= tilde) -> do poke (buf `plusPtr` bufi) c encode ps' (n - 1) buf (bufi + 1) | n < 3 -> encode ps 0 buf bufi | otherwise -> do let (x, y) = c `divMod` 16 h1 = intToUDigit x h2 = intToUDigit y poke (buf `plusPtr` bufi) equals poke (buf `plusPtr` (bufi + 1)) h1 poke (buf `plusPtr` (bufi + 2)) h2 encode ps' (n - 3) buf (bufi + 3) where ps' = B.tail ps newline = B.c2w '\n' tab = B.c2w '\t' space = B.c2w ' ' bang = B.c2w '!' tilde = B.c2w '~' equals = B.c2w '=' intToUDigit i | i >= 0 && i <= 9 = B.c2w '0' + i | i >= 10 && i <= 15 = B.c2w 'A' + i - 10 | otherwise = error $ "intToUDigit: '" ++ show i ++ "'not a digit"Why not
case B.head ps of c | c == newline -> do poke (buf `plusPtr` bufi) newline encode ps' qlineMax buf (bufi + 1) | n == 0 && B.length ps > 1 -> do poke (buf `plusPtr` bufi) equals poke (buf `plusPtr` (bufi + 1)) newline encode ps qlineMax buf (bufi + 2) | c == tab || c == space -> if B.null ps' || B.head ps' == newline then do poke (buf `plusPtr` bufi) c poke (buf `plusPtr` (bufi + 1)) equals poke (buf `plusPtr` (bufi + 2)) newline encode ps' qlineMax buf (bufi + 3) else do poke (buf `plusPtr` bufi) c encode ps' (n - 1) buf (bufi + 1) | (c >= bang && c /= equals && c <= tilde) -> do poke (buf `plusPtr` bufi) c encode ps' (n - 1) buf (bufi + 1) | n < 3 -> encode ps 0 buf bufi | otherwise -> do let (x, y) = c `divMod` 16 h1 = intToUDigit x h2 = intToUDigit y poke (buf `plusPtr` bufi) equals poke (buf `plusPtr` (bufi + 1)) h1 poke (buf `plusPtr` (bufi + 2)) h2 encode ps' (n - 3) buf (bufi + 3) where ps' = B.tail ps newline = B.c2w '\n' tab = B.c2w '\t' space = B.c2w ' ' bang = B.c2w '!' tilde = B.c2w '~' equals = B.c2w '=' intToUDigit i | i >= 0 && i <= 9 = B.c2w '0' + i | i >= 10 && i <= 15 = B.c2w 'A' + i - 10 | otherwise = error $ "intToUDigit: '" ++ show i ++ "'not a digit"
src/Darcs/Email.hs:132:24: Warning: Redundant bracket
Found
Found
case B.head ps of c | c == newline -> do poke (buf `plusPtr` bufi) newline encode ps' qlineMax buf (bufi + 1) | n == 0 && B.length ps > 1 -> do poke (buf `plusPtr` bufi) equals poke (buf `plusPtr` (bufi + 1)) newline encode ps qlineMax buf (bufi + 2) | (c == tab || c == space) -> if B.null ps' || B.head ps' == newline then do poke (buf `plusPtr` bufi) c poke (buf `plusPtr` (bufi + 1)) equals poke (buf `plusPtr` (bufi + 2)) newline encode ps' qlineMax buf (bufi + 3) else do poke (buf `plusPtr` bufi) c encode ps' (n - 1) buf (bufi + 1) | (c >= bang && c /= equals && c <= tilde) -> do poke (buf `plusPtr` bufi) c encode ps' (n - 1) buf (bufi + 1) | n < 3 -> encode ps 0 buf bufi | otherwise -> do let (x, y) = c `divMod` 16 h1 = intToUDigit x h2 = intToUDigit y poke (buf `plusPtr` bufi) equals poke (buf `plusPtr` (bufi + 1)) h1 poke (buf `plusPtr` (bufi + 2)) h2 encode ps' (n - 3) buf (bufi + 3) where ps' = B.tail ps newline = B.c2w '\n' tab = B.c2w '\t' space = B.c2w ' ' bang = B.c2w '!' tilde = B.c2w '~' equals = B.c2w '=' intToUDigit i | i >= 0 && i <= 9 = B.c2w '0' + i | i >= 10 && i <= 15 = B.c2w 'A' + i - 10 | otherwise = error $ "intToUDigit: '" ++ show i ++ "'not a digit"Why not
case B.head ps of c | c == newline -> do poke (buf `plusPtr` bufi) newline encode ps' qlineMax buf (bufi + 1) | n == 0 && B.length ps > 1 -> do poke (buf `plusPtr` bufi) equals poke (buf `plusPtr` (bufi + 1)) newline encode ps qlineMax buf (bufi + 2) | (c == tab || c == space) -> if B.null ps' || B.head ps' == newline then do poke (buf `plusPtr` bufi) c poke (buf `plusPtr` (bufi + 1)) equals poke (buf `plusPtr` (bufi + 2)) newline encode ps' qlineMax buf (bufi + 3) else do poke (buf `plusPtr` bufi) c encode ps' (n - 1) buf (bufi + 1) | c >= bang && c /= equals && c <= tilde -> do poke (buf `plusPtr` bufi) c encode ps' (n - 1) buf (bufi + 1) | n < 3 -> encode ps 0 buf bufi | otherwise -> do let (x, y) = c `divMod` 16 h1 = intToUDigit x h2 = intToUDigit y poke (buf `plusPtr` bufi) equals poke (buf `plusPtr` (bufi + 1)) h1 poke (buf `plusPtr` (bufi + 2)) h2 encode ps' (n - 3) buf (bufi + 3) where ps' = B.tail ps newline = B.c2w '\n' tab = B.c2w '\t' space = B.c2w ' ' bang = B.c2w '!' tilde = B.c2w '~' equals = B.c2w '=' intToUDigit i | i >= 0 && i <= 9 = B.c2w '0' + i | i >= 10 && i <= 15 = B.c2w 'A' + i - 10 | otherwise = error $ "intToUDigit: '" ++ show i ++ "'not a digit"
src/Darcs/Email.hs:140:8: Error: Use elem
Found
Found
c == tab || c == spaceWhy not
c `elem` [tab, space]
src/Darcs/Email.hs:198:46: Warning: Redundant bracket
Found
Found
(Maybe Doc) -> Maybe String -> Doc -> (Maybe String) -> DocWhy not
Maybe Doc -> Maybe String -> Doc -> (Maybe String) -> Doc
src/Darcs/Email.hs:198:84: Warning: Redundant bracket
Found
Found
(Maybe String) -> DocWhy not
Maybe String -> Doc
src/Darcs/ColorPrinter.hs:6:1: Error: Use fewer imports
Found
Found
import System.IO (stderr) import System.IO (hIsTerminalDevice, Handle)Why not
import System.IO (stderr, hIsTerminalDevice, Handle)
src/Darcs/ColorPrinter.hs:96:18: Warning: Use fmap
Found
Found
safeGetEnv s >>= return . (/= "0")Why not
fmap (/= "0") (safeGetEnv s)
src/Darcs/ColorPrinter.hs:189:6: Warning: Redundant bracket
Found
Found
(unsafeText printables) : (escape' rest)Why not
unsafeText printables : (escape' rest)
src/Darcs/ColorPrinter.hs:189:6: Warning: Redundant bracket
Found
Found
(unsafeText printables) : (escape' rest)Why not
(unsafeText printables) : escape' rest
src/Darcs/ColorPrinter.hs:190:23: Warning: Redundant bracket
Found
Found
(emph . unsafeText $ quoteChar c) : (escape' rest)Why not
(emph . unsafeText $ quoteChar c) : escape' rest
src/Darcs/ColorPrinter.hs:191:16: Warning: Redundant bracket
Found
Found
(noEscape po c) || (c == ' ')Why not
noEscape po c || (c == ' ')
src/Darcs/ColorPrinter.hs:192:11: Warning: Redundant bracket
Found
Found
(markEscape po)Why not
markEscape po
src/Darcs/ColorPrinter.hs:203:17: Warning: Redundant bracket
Found
Found
if (poIsprint po) then isPrint c else isPrintableAscii c || c >= '\128' && po8bit poWhy not
if poIsprint po then isPrint c else isPrintableAscii c || c >= '\128' && po8bit po
src/Darcs/SelectChanges.hs:18:1: Error: Unused LANGUAGE pragma
Found
Found
{-# LANGUAGE CPP, ForeignFunctionInterface #-}
Why not{-# LANGUAGE CPP #-}
src/Darcs/SelectChanges.hs:102:14: Error: Use elem
Found
Found
w == Last || w == FirstReversedWhy not
w `elem` [Last, FirstReversed]
src/Darcs/SelectChanges.hs:163:1: Error: Redundant lambda
Found
Found
triv = \ _ _ _ -> TrueWhy not
triv _ _ _ = True
src/Darcs/SelectChanges.hs:202:5: Warning: Redundant bracket
Found
Found
((liftR . patchesToConsider whch) >=> realSelectChanges whch >=> return . selectedPatches whch >=> (liftR . canonizeAfterSplitter))Why not
(liftR . patchesToConsider whch) >=> realSelectChanges whch >=> return . selectedPatches whch >=> (liftR . canonizeAfterSplitter)
src/Darcs/SelectChanges.hs:209:20: Warning: Redundant bracket
Found
Found
(invert b) :> (invert a)Why not
invert b :> (invert a)
src/Darcs/SelectChanges.hs:209:20: Warning: Redundant bracket
Found
Found
(invert b) :> (invert a)Why not
(invert b) :> invert a
src/Darcs/SelectChanges.hs:221:1: Error: Eta reduce
Found
Found
viewChanges opts' ps = textView opts' Nothing 0 [] psWhy not
viewChanges opts' = textView opts' Nothing 0 []
src/Darcs/SelectChanges.hs:233:16: Warning: Redundant $
Found
Found
(concat $ intersperse [""] $ map (map help) keypresses) ++ ["", "?: show this help", "", "<Space>: accept the current default (which is capitalized)"]Why not
concat (intersperse [""] $ map (map help) keypresses) ++ ["", "?: show this help", "", "<Space>: accept the current default (which is capitalized)"]
src/Darcs/SelectChanges.hs:233:17: Warning: Use intercalate
Found
Found
concat $ intersperse [""] $ map (map help) keypressesWhy not
intercalate [""] (map (map help) keypresses)
src/Darcs/SelectChanges.hs:243:12: Warning: Use String
Found
Found
[[KeyPress]] -> [Char]Why not
[[KeyPress]] -> String
src/Darcs/SelectChanges.hs:270:34: Warning: Redundant bracket
Found
Found
FL (PatchInfoAnd p) :> (PatchInfoAnd p)Why not
FL (PatchInfoAnd p) :> PatchInfoAnd p
src/Darcs/SelectChanges.hs:281:17: Warning: Redundant $
Found
Found
promptChar $ PromptConfig{pPrompt = prompt', pBasicCharacters = keysFor basicOptions, pAdvancedCharacters = keysFor advancedOptions, pDefault = Just 'n', pHelp = "?h"}Why not
promptChar PromptConfig{pPrompt = prompt', pBasicCharacters = keysFor basicOptions, pAdvancedCharacters = keysFor advancedOptions, pDefault = Just 'n', pHelp = "?h"}
src/Darcs/SelectChanges.hs:299:23: Warning: Redundant $
Found
Found
exitWith $ ExitSuccessWhy not
exitWith ExitSuccess
src/Darcs/SelectChanges.hs:302:21: Warning: Redundant $
Found
Found
(toUpper $ head jn) : tail jnWhy not
toUpper (head jn) : tail jn
src/Darcs/SelectChanges.hs:404:15: Warning: Redundant bracket
Found
Found
mapFL_FL tpPatch (xs) :> (mapFL_FL tpPatch (ys))Why not
mapFL_FL tpPatch (xs) :> mapFL_FL tpPatch (ys)
src/Darcs/SelectChanges.hs:404:32: Error: Redundant bracket
Found
Found
(xs)Why not
xs
src/Darcs/SelectChanges.hs:404:58: Error: Redundant bracket
Found
Found
(ys)Why not
ys
src/Darcs/SelectChanges.hs:408:21: Warning: Redundant bracket
Found
Found
(mapFL_FL tpPatch (fc +>+ mc)) :> (mapFL_FL tpPatch lc)Why not
mapFL_FL tpPatch (fc +>+ mc) :> (mapFL_FL tpPatch lc)
src/Darcs/SelectChanges.hs:408:21: Warning: Redundant bracket
Found
Found
(mapFL_FL tpPatch (fc +>+ mc)) :> (mapFL_FL tpPatch lc)Why not
(mapFL_FL tpPatch (fc +>+ mc)) :> mapFL_FL tpPatch lc
src/Darcs/SelectChanges.hs:429:22: Warning: Redundant $
Found
Found
execStateT (skipMundane whch >> showCur whch >> textSelectIfAny) $ ISC{total = lengthFL tps', current = 0, tps = FZipper NilRL tps', choices = pcs}Why not
execStateT (skipMundane whch >> showCur whch >> textSelectIfAny) ISC{total = lengthFL tps', current = 0, tps = FZipper NilRL tps', choices = pcs}
src/Darcs/SelectChanges.hs:439:13: Error: Use unless
Found
Found
if rightmost z then return () else textSelect' whchWhy not
(unless (rightmost z) $ textSelect' whch)
src/Darcs/SelectChanges.hs:447:11: Warning: Redundant bracket
Found
Found
if (not $ rightmost z) then textSelectOne whch else lastQuestion whchWhy not
if not $ rightmost z then textSelectOne whch else lastQuestion whch
src/Darcs/SelectChanges.hs:452:17: Warning: Use String
Found
Found
[Char] -> [Char] -> [KeyPress]Why not
String -> String -> [KeyPress]
src/Darcs/SelectChanges.hs:456:20: Error: Redundant bracket
Found
Found
("wait and decide later, defaulting to no")Why not
"wait and decide later, defaulting to no"
src/Darcs/SelectChanges.hs:458:16: Warning: Use String
Found
Found
[Char] -> [KeyPress]Why not
String -> [KeyPress]
src/Darcs/SelectChanges.hs:481:6: Warning: Use list comprehension
Found
Found
if not isLast then [KeyPress 'j' ("skip to next " ++ aThing)] else []Why not
[KeyPress 'j' ("skip to next " ++ aThing) | not isLast]
src/Darcs/SelectChanges.hs:497:20: Error: Redundant bracket
Found
Found
("confirm this operation")Why not
"confirm this operation"
src/Darcs/SelectChanges.hs:499:22: Error: Redundant bracket
Found
Found
("list all selected")Why not
"list all selected"
src/Darcs/SelectChanges.hs:512:3: Warning: Redundant $
Found
Found
return $ ([optionsBasic jn aThing], [optionsSplit split aThing] ++ (if single then [optionsFile jn] else []) ++ [optionsView aThing someThings ++ if Summary `elem` o then [] else optionsSummary aThing] ++ [optionsQuit jn someThings] ++ [optionsNav aThing False])Why not
return ([optionsBasic jn aThing], [optionsSplit split aThing] ++ (if single then [optionsFile jn] else []) ++ [optionsView aThing someThings ++ if Summary `elem` o then [] else optionsSummary aThing] ++ [optionsQuit jn someThings] ++ [optionsNav aThing False])
src/Darcs/SelectChanges.hs:515:18: Warning: Use list comprehension
Found
Found
if single then [optionsFile jn] else []Why not
[optionsFile jn | single]
src/Darcs/SelectChanges.hs:605:5: Warning: Redundant bracket
Found
Found
case (applySplitter s (tpPatch tp)) of Nothing -> return () Just (text, parse) -> do newText <- liftIO $ editText "darcs-patch-edit" text case parse newText of Nothing -> return () Just ps -> do tps_new <- liftIO . return . snd $ patchChoicesTpsSub (Just (tag tp)) ps modify $ \ isc -> isc{total = (total isc + lengthFL tps_new - 1), tps = (FZipper tps_done (tps_new +>+ tps_todo)), choices = (substitute (seal2 (tp :||: tps_new)) (choices isc))}Why not
case applySplitter s (tpPatch tp) of Nothing -> return () Just (text, parse) -> do newText <- liftIO $ editText "darcs-patch-edit" text case parse newText of Nothing -> return () Just ps -> do tps_new <- liftIO . return . snd $ patchChoicesTpsSub (Just (tag tp)) ps modify $ \ isc -> isc{total = (total isc + lengthFL tps_new - 1), tps = (FZipper tps_done (tps_new +>+ tps_todo)), choices = (substitute (seal2 (tp :||: tps_new)) (choices isc))}
src/Darcs/SelectChanges.hs:615:35: Warning: Redundant bracket
Found
Found
isc{total = (total isc + lengthFL tps_new - 1), tps = (FZipper tps_done (tps_new +>+ tps_todo)), choices = (substitute (seal2 (tp :||: tps_new)) (choices isc))}Why not
isc{total = total isc + lengthFL tps_new - 1, tps = (FZipper tps_done (tps_new +>+ tps_todo)), choices = (substitute (seal2 (tp :||: tps_new)) (choices isc))}
src/Darcs/SelectChanges.hs:615:35: Warning: Redundant bracket
Found
Found
isc{total = (total isc + lengthFL tps_new - 1), tps = (FZipper tps_done (tps_new +>+ tps_todo)), choices = (substitute (seal2 (tp :||: tps_new)) (choices isc))}Why not
isc{total = (total isc + lengthFL tps_new - 1), tps = FZipper tps_done (tps_new +>+ tps_todo), choices = (substitute (seal2 (tp :||: tps_new)) (choices isc))}
src/Darcs/SelectChanges.hs:615:35: Warning: Redundant bracket
Found
Found
isc{total = (total isc + lengthFL tps_new - 1), tps = (FZipper tps_done (tps_new +>+ tps_todo)), choices = (substitute (seal2 (tp :||: tps_new)) (choices isc))}Why not
isc{total = (total isc + lengthFL tps_new - 1), tps = (FZipper tps_done (tps_new +>+ tps_todo)), choices = substitute (seal2 (tp :||: tps_new)) (choices isc)}
src/Darcs/SelectChanges.hs:634:16: Warning: Redundant $
Found
Found
mapFL (repr whichch . Sealed2 . tpPatch) $ last_chsWhy not
mapFL (repr whichch . Sealed2 . tpPatch) last_chs
src/Darcs/SelectChanges.hs:636:16: Warning: Redundant $
Found
Found
mapFL (repr whichch . Sealed2 . tpPatch) $ first_chsWhy not
mapFL (repr whichch . Sealed2 . tpPatch) first_chs
src/Darcs/SelectChanges.hs:657:11: Error: Redundant do
Found
Found
do modify $ \ isc -> isc{tps = toEnd $ tps isc}Why not
modify $ \ isc -> isc{tps = toEnd $ tps isc}
src/Darcs/SelectChanges.hs:662:11: Error: Redundant do
Found
Found
do modify $ \ isc -> isc{tps = toStart $ tps isc, current = 0}Why not
modify $ \ isc -> isc{tps = toStart $ tps isc, current = 0}
src/Darcs/SelectChanges.hs:673:14: Error: Use when
Found
Found
if jn `elem` ["unpull", "unrecord", "obliterate"] then do yorn <- askUser $ "Really " ++ jn ++ " all undecided patches? " case yorn of ('y' : _) -> return () _ -> exitWith $ ExitSuccess else return ()Why not
(when (jn `elem` ["unpull", "unrecord", "obliterate"]) $ do yorn <- askUser $ "Really " ++ jn ++ " all undecided patches? " case yorn of ('y' : _) -> return () _ -> exitWith $ ExitSuccess)
src/Darcs/SelectChanges.hs:678:23: Warning: Redundant $
Found
Found
exitWith $ ExitSuccessWhy not
exitWith ExitSuccess
src/Darcs/SelectChanges.hs:683:9: Warning: Use fmap
Found
Found
gets choices >>= return . Darcs.Patch.thing . helperWhy not
fmap (Darcs.Patch.thing . helper) (gets choices)
src/Darcs/SelectChanges.hs:690:10: Warning: Use fmap
Found
Found
gets choices >>= return . Darcs.Patch.things . helperWhy not
fmap (Darcs.Patch.things . helper) (gets choices)
src/Darcs/SelectChanges.hs:711:12: Warning: Redundant $
Found
Found
promptChar $ PromptConfig{pPrompt = thePrompt, pBasicCharacters = keysFor basicOptions, pAdvancedCharacters = keysFor advancedOptions, pDefault = Just def, pHelp = "?h"}Why not
promptChar PromptConfig{pPrompt = thePrompt, pBasicCharacters = keysFor basicOptions, pAdvancedCharacters = keysFor advancedOptions, pDefault = Just def, pHelp = "?h"}
src/Darcs/SelectChanges.hs:734:40: Error: Use elem
Found
Found
whichch == Last || whichch == FirstReversedWhy not
whichch `elem` [Last, FirstReversed]
src/Darcs/SelectChanges.hs:735:26: Warning: Redundant $
Found
Found
(toUpper $ head jn) : tail jnWhy not
toUpper (head jn) : tail jn
src/Darcs/SelectChanges.hs:764:53: Error: Use elem
Found
Found
whichch == Last || whichch == FirstReversedWhy not
whichch `elem` [Last, FirstReversed]
src/Darcs/SelectChanges.hs:769:26: Warning: Redundant $
Found
Found
exitWith $ ExitSuccessWhy not
exitWith ExitSuccess
src/Darcs/SelectChanges.hs:794:26: Warning: Redundant $
Found
Found
exitWith $ ExitSuccessWhy not
exitWith ExitSuccess
src/Darcs/SelectChanges.hs:811:14: Warning: Redundant bracket
Found
Found
liftIO . (unseal2 (printFriendly p o))Why not
liftIO . unseal2 (printFriendly p o)
src/Darcs/SelectChanges.hs:854:22: Warning: Use :
Found
Found
[optionsView' ++ if Summary `elem` o then [] else optionsSummary'] ++ [optionsNav']Why not
(optionsView' ++ if Summary `elem` o then [] else optionsSummary') : [optionsNav']
src/Darcs/SelectChanges.hs:895:16: Warning: Redundant $
Found
Found
spanFL (not . (crit whichch o) . seal2 . tpPatch) $ unskippedWhy not
spanFL (not . (crit whichch o) . seal2 . tpPatch) unskipped
src/Darcs/SelectChanges.hs:895:28: Warning: Redundant bracket
Found
Found
(crit whichch o) . seal2 . tpPatchWhy not
crit whichch o . seal2 . tpPatch
src/Darcs/SelectChanges.hs:902:28: Warning: Redundant bracket
Found
Found
isc{tps = (FZipper (reverseFL boring +<+ reverseFL skipped +<+ tps_done) interesting)}Why not
isc{tps = FZipper (reverseFL boring +<+ reverseFL skipped +<+ tps_done) interesting}
src/Darcs/SelectChanges.hs:940:20: Warning: Redundant bracket
Found
Found
fmap n2pia . (anonymous . fromPrims)Why not
fmap n2pia . anonymous . fromPrims
src/Darcs/Test.hs:22:1: Error: Use fewer imports
Found
Found
import Darcs.Utils (withCurrentDirectory) import Darcs.Utils (askUser)Why not
import Darcs.Utils (withCurrentDirectory, askUser)
src/Darcs/Test.hs:36:18: Error: Use unless
Found
Found
when (not $ Quiet `elem` opts)Why not
unless (Quiet `elem` opts)
src/Darcs/Test.hs:36:24: Error: Use notElem
Found
Found
not $ Quiet `elem` optsWhy not
notElem Quiet opts
src/Darcs/Annotate.hs:228:15: Warning: Redundant $
Found
Found
unlines $ [show n ++ ": " ++ renderString (humanFriendly i) | (n :: Int, i) <- zip [1 ..] pis]Why not
unlines [show n ++ ": " ++ renderString (humanFriendly i) | (n :: Int, i) <- zip [1 ..] pis]
src/Darcs/Annotate.hs:235:17: Error: Use mapMaybe
Found
Found
catMaybes . map fst $ V.toList (annotated a)Why not
mapMaybe fst (V.toList (annotated a))
src/Darcs/Annotate.hs:235:17: Error: Use mapMaybe
Found
Found
catMaybes . map fstWhy not
mapMaybe fst
src/Darcs/Annotate.hs:244:44: Warning: Use :
Found
Found
"#" ++ show nWhy not
'#' : show n
src/Darcs/Annotate.hs:247:17: Warning: Redundant bracket
Found
Found
replicate (n - length str) ' ' ++ (take n str)Why not
replicate (n - length str) ' ' ++ take n str
src/Darcs/External.hs:2:1: Error: Unused LANGUAGE pragma
Found
Found
{-# LANGUAGE CPP, ForeignFunctionInterface #-}
Why not{-# LANGUAGE CPP #-}
src/Darcs/External.hs:31:1: Error: Use fewer imports
Found
Found
import System.Posix.Files (getSymbolicLinkStatus, isRegularFile, isDirectory) import System.Posix.Files (createLink)Why not
import System.Posix.Files (getSymbolicLinkStatus, isRegularFile, isDirectory, createLink)
src/Darcs/External.hs:57:1: Error: Use fewer imports
Found
Found
import Darcs.Utils (breakCommand, getViewer, ortryrunning) import Darcs.Utils (catchall)Why not
import Darcs.Utils (breakCommand, getViewer, ortryrunning, catchall)
src/Darcs/External.hs:69:1: Error: Use fewer imports
Found
Found
import URL (copyUrl, copyUrlFirst, waitUrl) import URL (Cachable(..))Why not
import URL (copyUrl, copyUrlFirst, waitUrl, Cachable(..))
src/Darcs/External.hs:450:8: Error: Reduce duplication
Found
Found
(i, o, e, pid) <- runInteractiveProcess c args Nothing Nothing _ <- forkIO $ hPutDoc i instr >> hClose i mvare <- newEmptyMVar _ <- forkIO ((Ratified.hGetContents e >>= hPutStr stderr) `finally` putMVar mvare ()) out <- B.hGetContents oWhy not
Combine with src/Darcs/External.hs:468:8
src/Darcs/External.hs:132:17: Warning: Redundant bracket
Found
Found
if (existsF || existsD) then helper (i + 1) else do putStrLn $ "Backing up " ++ f ++ "(" ++ suffix ++ ")" backup f nextWhy not
if existsF || existsD then helper (i + 1) else do putStrLn $ "Backing up " ++ f ++ "(" ++ suffix ++ ")" backup f next
src/Darcs/External.hs:172:1: Error: Eta reduce
Found
Found
fetchFileLazyPS x c = copyAndReadFile BL.readFile x cWhy not
fetchFileLazyPS = copyAndReadFile BL.readFile
src/Darcs/External.hs:219:20: Error: Use unless
Found
Found
if isDoesNotExistError e then return () else ioError eWhy not
Control.Monad.unless (isDoesNotExistError e) $ ioError e
src/Darcs/External.hs:226:44: Error: Redundant bracket
Found
Found
(String)Why not
String
src/Darcs/External.hs:279:17: Error: Use putStr
Found
Found
hPutStr stdoutWhy not
putStr
src/Darcs/External.hs:312:6: Error: Use unless
Found
Found
when (not (null cc))Why not
unless (null cc)
src/Darcs/External.hs:345:24: Warning: Redundant $
Found
Found
hPutDocLn hat $ bundleWhy not
hPutDocLn hat bundle
src/Darcs/External.hs:370:9: Warning: Redundant $
Found
Found
fail $ "no mail facility (sendmail or mapi) located at configure time!"Why not
fail "no mail facility (sendmail or mapi) located at configure time!"
src/Darcs/External.hs:429:20: Warning: Redundant $
Found
Found
fail $ ("failed to send mail, invalid sendmail-command: " ++ (show e))Why not
fail ("failed to send mail, invalid sendmail-command: " ++ (show e))
src/Darcs/External.hs:429:28: Warning: Redundant bracket
Found
Found
"failed to send mail, invalid sendmail-command: " ++ (show e)Why not
"failed to send mail, invalid sendmail-command: " ++ show e
src/Darcs/External.hs:430:15: Warning: Redundant $
Found
Found
fail $ ("failed to send mail, invalid sendmail-command")Why not
fail ("failed to send mail, invalid sendmail-command")
src/Darcs/External.hs:430:22: Error: Redundant bracket
Found
Found
("failed to send mail, invalid sendmail-command")Why not
"failed to send mail, invalid sendmail-command"
src/Darcs/External.hs:487:1: Error: Eta reduce
Found
Found
signPGP args t = execDocPipe "gpg" ("--clearsign" : args) tWhy not
signPGP args = execDocPipe "gpg" ("--clearsign" : args)
src/Darcs/External.hs:548:18: Error: Use notElem
Found
Found
not $ key_used `elem` allowed_keysWhy not
notElem key_used allowed_keys
src/Darcs/External.hs:614:18: Error: Redundant do
Found
Found
do waitForProcess =<< runProcess c args Nothing Nothing (Just h) Nothing NothingWhy not
waitForProcess =<< runProcess c args Nothing Nothing (Just h) Nothing Nothing
src/Darcs/Commands.hs:56:1: Error: Eta reduce
Found
Found
extractCommands cs = concatMap (\ x -> case x of CommandData cmd_d -> [cmd_d] _ -> []) csWhy not
extractCommands = concatMap (\ x -> case x of CommandData cmd_d -> [cmd_d] _ -> [])
src/Darcs/Commands.hs:57:1: Error: Eta reduce
Found
Found
extractHiddenCommands cs = concatMap (\ x -> case x of HiddenCommand cmd_d -> [cmd_d] _ -> []) csWhy not
extractHiddenCommands = concatMap (\ x -> case x of HiddenCommand cmd_d -> [cmd_d] _ -> [])
src/Darcs/Commands.hs:98:1: Error: Eta reduce
Found
Found
nodefaults _ _ xs = return xsWhy not
nodefaults _ _ = return
src/Darcs/Commands.hs:136:5: Warning: Redundant bracket
Found
Found
(usageInfo ("Usage: " ++ commandProgramName super ++ " " ++ commandName super ++ " SUBCOMMAND ... " ++ "\n\n" ++ commandDescription super ++ "\n\nSubcommands:\n" ++ usageHelper (getSubcommands super) ++ "\nOptions:") (optionFromDarcsOption rootDirectory help)) ++ "\n" ++ commandHelp superWhy not
usageInfo ("Usage: " ++ commandProgramName super ++ " " ++ commandName super ++ " SUBCOMMAND ... " ++ "\n\n" ++ commandDescription super ++ "\n\nSubcommands:\n" ++ usageHelper (getSubcommands super) ++ "\nOptions:") (optionFromDarcsOption rootDirectory help) ++ "\n" ++ commandHelp super
src/Darcs/Commands.hs:146:14: Warning: Redundant bracket
Found
Found
(CommandData c) : csWhy not
CommandData c : cs
src/Darcs/Commands.hs:148:14: Warning: Redundant bracket
Found
Found
(GroupName n) : csWhy not
GroupName n : cs
src/Darcs/Commands.hs:165:6: Warning: Redundant bracket
Found
Found
(maybe "" (\ c -> commandName c ++ " ") msuper) ++ commandName cmd ++ " for details."Why not
maybe "" (\ c -> commandName c ++ " ") msuper ++ commandName cmd ++ " for details."
src/Darcs/Commands.hs:186:30: Warning: Redundant bracket
Found
Found
"\n\nSubcommands:\n" ++ (usageHelper s)Why not
"\n\nSubcommands:\n" ++ usageHelper s
src/Darcs/Commands.hs:212:7: Warning: Redundant bracket
Found
Found
(subcs, (a : as))Why not
(subcs, a : as)
src/Darcs/RemoteApply.hs:18:9: Warning: Use guards
Found
Found
Nothing -> if isSshUrl repodir then applyViaSsh opts (splitSshUrl repodir) bundle else if isHttpUrl repodir then applyViaUrl opts repodir bundle else applyViaLocal opts repodir bundleWhy not
Nothing | isSshUrl repodir -> applyViaSsh opts (splitSshUrl repodir) bundle | isHttpUrl repodir -> applyViaUrl opts repodir bundle | otherwise -> applyViaLocal opts repodir bundle
src/Darcs/RemoteApply.hs:50:1: Error: Eta reduce
Found
Found
applyViaSsh opts repo bundle = pipeDocSSH repo [Ssh.remoteDarcs (remoteDarcs opts) ++ " apply --all " ++ unwords (applyopts opts) ++ " --repodir '" ++ (sshRepo repo) ++ "'"] bundleWhy not
applyViaSsh opts repo = pipeDocSSH repo [Ssh.remoteDarcs (remoteDarcs opts) ++ " apply --all " ++ unwords (applyopts opts) ++ " --repodir '" ++ (sshRepo repo) ++ "'"]
src/Darcs/RemoteApply.hs:52:38: Warning: Redundant bracket
Found
Found
(sshRepo repo) ++ "'"Why not
sshRepo repo ++ "'"
src/Darcs/RemoteApply.hs:55:1: Error: Eta reduce
Found
Found
applyViaSshAndSudo opts repo username bundle = pipeDocSSH repo ["sudo -u " ++ username ++ " " ++ Ssh.remoteDarcs (remoteDarcs opts) ++ " apply --all --repodir '" ++ (sshRepo repo) ++ "'"] bundleWhy not
applyViaSshAndSudo opts repo username = pipeDocSSH repo ["sudo -u " ++ username ++ " " ++ Ssh.remoteDarcs (remoteDarcs opts) ++ " apply --all --repodir '" ++ (sshRepo repo) ++ "'"]
src/Darcs/RemoteApply.hs:57:50: Warning: Redundant bracket
Found
Found
(sshRepo repo) ++ "'"Why not
sshRepo repo ++ "'"
src/Darcs/RemoteApply.hs:60:18: Warning: Use list comprehension
Found
Found
if Debug `elem` opts then ["--debug"] else []Why not
["--debug" | Debug `elem` opts]
src/Darcs/CommandsAux.hs:53:5: Error: Use when
Found
Found
if check_is_on && or (mapFL hasMaliciousPath patches) then fail $ unlines $ ["Malicious path in patch:"] ++ (map (\ s -> " " ++ s) $ concat $ mapFL maliciousPaths patches) ++ ["", "If you are sure this is ok then you can run again with the --dont-restrict-paths option."] else return ()Why not
Control.Monad.when (check_is_on && or (mapFL hasMaliciousPath patches)) $ fail $ unlines $ ["Malicious path in patch:"] ++ (map (\ s -> " " ++ s) $ concat $ mapFL maliciousPaths patches) ++ ["", "If you are sure this is ok then you can run again with the --dont-restrict-paths option."]
src/Darcs/CommandsAux.hs:55:29: Warning: Redundant $
Found
Found
(map (\ s -> " " ++ s) $ concat $ mapFL maliciousPaths patches) ++ ["", "If you are sure this is ok then you can run again with the --dont-restrict-paths option."]Why not
map (\ s -> " " ++ s) (concat $ mapFL maliciousPaths patches) ++ ["", "If you are sure this is ok then you can run again with the --dont-restrict-paths option."]
src/Darcs/CommandsAux.hs:66:1: Error: Eta reduce
Found
Found
maliciousPatches to_check = filter (unseal2 hasMaliciousPath) to_checkWhy not
maliciousPatches = filter (unseal2 hasMaliciousPath)
src/Darcs/Lock.hs:18:1: Error: Unused LANGUAGE pragma
Found
Found
{-# LANGUAGE CPP, ForeignFunctionInterface #-}
Why not{-# LANGUAGE CPP #-}
src/Darcs/Lock.hs:53:1: Error: Use fewer imports
Found
Found
import Darcs.Utils (withCurrentDirectory, maybeGetEnv, firstJustIO, runEditor) import Darcs.Utils (catchall, addToErrorLoc)Why not
import Darcs.Utils (withCurrentDirectory, maybeGetEnv, firstJustIO, runEditor, catchall, addToErrorLoc)
src/Darcs/Lock.hs:86:28: Warning: Use fmap
Found
Found
job >>= (return . Right)Why not
fmap Right job
src/Darcs/Lock.hs:111:1: Error: Eta reduce
Found
Found
releaseLock s = removeFileMayNotExist sWhy not
releaseLock = removeFileMayNotExist
src/Darcs/Lock.hs:160:14: Warning: Use fmap
Found
Found
firstJustIO [readBinFile (darcsdir ++ "/prefs/tmpdir") >>= return . Just . head . words >>= chkdir, maybeGetEnv "DARCS_TMPDIR" >>= chkdir, getTemporaryDirectory >>= chkdir . Just, getCurrentDirectorySansDarcs, return $ Just "."] >>= return . fromJustWhy not
fmap fromJust (firstJustIO [readBinFile (darcsdir ++ "/prefs/tmpdir") >>= return . Just . head . words >>= chkdir, maybeGetEnv "DARCS_TMPDIR" >>= chkdir, getTemporaryDirectory >>= chkdir . Just, getCurrentDirectorySansDarcs, return $ Just "."])
src/Darcs/Lock.hs:160:28: Warning: Use fmap
Found
Found
readBinFile (darcsdir ++ "/prefs/tmpdir") >>= return . Just . head . wordsWhy not
fmap (Just . head . words) (readBinFile (darcsdir ++ "/prefs/tmpdir"))
src/Darcs/Lock.hs:168:29: Warning: Use fmap
Found
Found
doesDirectoryExist d >>= return . \ e -> if e then Just (d ++ "/") else NothingWhy not
fmap (\ e -> if e then Just (d ++ "/") else Nothing) (doesDirectoryExist d)
src/Darcs/Lock.hs:183:22: Error: Use notElem
Found
Found
not $ darcsdir `elem` splitDirectories xWhy not
notElem darcsdir (splitDirectories x)
src/Darcs/Match.hs:163:22: Warning: Redundant $
Found
Found
applyInvRL `unsealFlipped` (safetake n $ newset2RL repo)Why not
applyInvRL `unsealFlipped` safetake n (newset2RL repo)
src/Darcs/Match.hs:169:14: Warning: Redundant $
Found
Found
either fail (const $ return ()) $ (parseMatch p :: Either String (MatchFun DummyPatch))Why not
either fail (const $ return ()) (parseMatch p :: Either String (MatchFun DummyPatch))
src/Darcs/Match.hs:263:35: Warning: Redundant bracket
Found
Found
(unseal myhead) $ dropn (a - 1) psWhy not
unseal myhead $ dropn (a - 1) ps
src/Darcs/Match.hs:375:40: Warning: Redundant $
Found
Found
applyMatcher m $ pWhy not
applyMatcher m p
src/Darcs/Match.hs:407:17: Warning: Redundant bracket
Found
Found
patch2patchinfo `unseal2` (findAPatch match repo)Why not
patch2patchinfo `unseal2` findAPatch match repo
src/Darcs/RunCommand.hs:51:1: Error: Use fewer imports
Found
Found
import Darcs.Global (atexit) import Darcs.Global (setDebugMode, setTimingsMode)Why not
import Darcs.Global (atexit, setDebugMode, setTimingsMode)
src/Darcs/RunCommand.hs:110:14: Warning: Redundant bracket
Found
Found
(commandArgdefaults cmd) specopsWhy not
commandArgdefaults cmd specops
src/Darcs/RunCommand.hs:125:16: Warning: Redundant $
Found
Found
when (NoHTTPPipelining `elem` os) $ disableHTTPPipeliningWhy not
when (NoHTTPPipelining `elem` os) disableHTTPPipelining
src/Darcs/RunCommand.hs:133:27: Warning: Redundant bracket
Found
Found
(commandCommand cmd) (fixFlag : fixedOs)Why not
commandCommand cmd (fixFlag : fixedOs)
src/Darcs/RunCommand.hs:190:39: Warning: Redundant bracket
Found
Found
(commandName super) ++ " disabled with --disable option!"Why not
commandName super ++ " disabled with --disable option!"
src/Darcs/Repository.hs:360:7: Warning: Redundant $
Found
Found
fetchPatchesIfNecessary opts torepository `catchInterrupt` (putInfo opts $ text "Using lazy repository.")Why not
fetchPatchesIfNecessary opts torepository `catchInterrupt` putInfo opts (text "Using lazy repository.")
src/Darcs/Repository.hs:415:19: Warning: Redundant $
Found
Found
(do cleanDir "patches" putInfo opts $ text "Copying patches, to get lazy repository hit ctrl-C..." unpackPatches toCache3 (mapFL hashedPatchFileName $ newset2FL us) . Tar.read . decompress =<< fetchFileLazyPS (fromPacksDir ++ "patches.tar.gz") Uncachable) `catchInterrupt` (putInfo opts $ text "Using lazy repository.")Why not
(do cleanDir "patches" putInfo opts $ text "Copying patches, to get lazy repository hit ctrl-C..." unpackPatches toCache3 (mapFL hashedPatchFileName $ newset2FL us) . Tar.read . decompress =<< fetchFileLazyPS (fromPacksDir ++ "patches.tar.gz") Uncachable) `catchInterrupt` putInfo opts (text "Using lazy repository.")
src/Darcs/Repository.hs:435:17: Error: Redundant flip
Found
Found
flip finally (putMVar mv ()) fWhy not
finally f (putMVar mv ())
src/Darcs/Repository.hs:599:37: Warning: Redundant bracket
Found
Found
(either (const Nothing) Just) . extractHashWhy not
either (const Nothing) Just . extractHash
src/Darcs/Usage.hs:33:10: Error: Eta reduce
Found
Found
unlines' xs = concatMap (\ x -> x ++ ",\n" ++ prePad) xsWhy not
unlines' = concatMap (\ x -> x ++ ",\n" ++ prePad)
src/Darcs/Usage.hs:57:29: Warning: Use :
Found
Found
"-" ++ [so]Why not
'-' : [so]
src/Darcs/Flags.hs:204:21: Error: Use elem
Found
Found
(f == PauseForGui) || (f == NoPauseForGui)Why not
f `elem` [PauseForGui, NoPauseForGui]
src/Darcs/Patch.hs:94:1: Error: Use fewer imports
Found
Found
import Darcs.Patch.Apply (applyToFilePaths, effectOnFilePaths, applyToTree) import Darcs.Patch.Apply (ApplyState)Why not
import Darcs.Patch.Apply (applyToFilePaths, effectOnFilePaths, applyToTree, ApplyState)
src/Darcs/IO.hs:145:9: Warning: Reduce duplication
Found
Found
x = fn2fp a y = fn2fp b couldNotRename = "Could not rename " ++ x ++ " to " ++ yWhy not
Combine with src/Darcs/IO.hs:179:9
src/Darcs/IO.hs:57:24: Error: Use unless
Found
Found
when (not $ B.null x)Why not
unless (B.null x)
src/Darcs/IO.hs:66:26: Error: Use unless
Found
Found
if isDoesNotExistError e then return () else ioError eWhy not
Control.Monad.unless (isDoesNotExistError e) $ ioError e
src/Darcs/IO.hs:81:5: Error: Eta reduce
Found
Found
runTM io = TIO ioWhy not
runTM = TIO
src/Darcs/IO.hs:87:5: Error: Eta reduce
Found
Found
runTM io = SIO ioWhy not
runTM = SIO
src/Darcs/IO.hs:133:44: Warning: Redundant bracket
Found
Found
if (map toLower x == map toLower y) then backupByCopying (fn2fp b) else backupByRenaming (fn2fp b)Why not
if map toLower x == map toLower y then backupByCopying (fn2fp b) else backupByRenaming (fn2fp b)
src/Darcs/IO.hs:167:44: Warning: Redundant bracket
Found
Found
if (map toLower x == map toLower y) then backupByCopying (fn2fp b) else backupByRenaming (fn2fp b)Why not
if map toLower x == map toLower y then backupByCopying (fn2fp b) else backupByRenaming (fn2fp b)
src/Darcs/Arguments.hs:96:1: Error: Use fewer imports
Found
Found
import Storage.Hashed.Tree (list, expand, emptyTree) import Storage.Hashed.Tree (Tree)Why not
import Storage.Hashed.Tree (list, expand, emptyTree, Tree)
src/Darcs/Arguments.hs:106:1: Error: Use fewer imports
Found
Found
import Printer (renderString) import Printer (Doc, putDocLn, text, vsep, ($$), vcat, insertBeforeLastline, prefix)Why not
import Printer (renderString, Doc, putDocLn, text, vsep, ($$), vcat, insertBeforeLastline, prefix)
src/Darcs/Arguments.hs:108:1: Error: Use fewer imports
Found
Found
import Darcs.Patch (listTouchedFiles) import Darcs.Patch (RepoPatch, Patchy, showNicely, description, xmlSummary) import qualified Darcs.Patch (summary)Why not
import Darcs.Patch (listTouchedFiles, RepoPatch, Patchy, showNicely, description, xmlSummary) import qualified Darcs.Patch (summary)
src/Darcs/Arguments.hs:123:1: Error: Use fewer imports
Found
Found
import Darcs.Repository (setScriptsExecutablePatches) import Darcs.Repository (withRepository, RepoJob(..))Why not
import Darcs.Repository (setScriptsExecutablePatches, withRepository, RepoJob(..))
src/Darcs/Arguments.hs:378:22: Warning: Use String
Found
Found
[Char]Why not
String
src/Darcs/Arguments.hs:383:26: Warning: Use String
Found
Found
[Char]Why not
String
src/Darcs/Arguments.hs:388:31: Warning: Use String
Found
Found
[Char]Why not
String
src/Darcs/Arguments.hs:392:29: Warning: Use String
Found
Found
[Char]Why not
String
src/Darcs/Arguments.hs:399:24: Warning: Use String
Found
Found
[Char]Why not
String
src/Darcs/Arguments.hs:479:17: Warning: Redundant bracket
Found
Found
(FixFilePath repo orig) : _Why not
FixFilePath repo orig : _
src/Darcs/Arguments.hs:520:13: Warning: Use fromMaybe
Found
Found
case extractFixPath flags of Just xxx -> xxx Nothing -> bug "Can't fix path in fixSubPaths"Why not
fromMaybe (bug "Can't fix path in fixSubPaths") (extractFixPath flags)
src/Darcs/Arguments.hs:541:24: Warning: Redundant $
Found
Found
nub . catMaybes <$> (maybeFixSubPaths flags $ filter (not . null) fs)Why not
nub . catMaybes <$> maybeFixSubPaths flags (filter (not . null) fs)
src/Darcs/Arguments.hs:554:41: Warning: Redundant bracket
Found
Found
[('-' : '-' : s), arg]Why not
['-' : '-' : s, arg]
src/Darcs/Arguments.hs:579:45: Warning: Use string literal
Found
Found
['h']Why not
"h"
src/Darcs/Arguments.hs:594:35: Warning: Use string literal
Found
Found
['v']Why not
"v"
src/Darcs/Arguments.hs:596:35: Warning: Use string literal
Found
Found
['q']Why not
"q"
src/Darcs/Arguments.hs:625:54: Warning: Use string literal
Found
Found
['m']Why not
"m"
src/Darcs/Arguments.hs:652:19: Warning: Redundant $
Found
Found
concatOptions $ [matchTo, matchFrom, DarcsMultipleChoiceOption [__match, __patch, __last, __indexes]]Why not
concatOptions [matchTo, matchFrom, DarcsMultipleChoiceOption [__match, __patch, __last, __indexes]]
src/Darcs/Arguments.hs:679:24: Warning: Use string literal
Found
Found
['t']Why not
"t"
src/Darcs/Arguments.hs:681:25: Warning: Use string literal
Found
Found
['t']Why not
"t"
src/Darcs/Arguments.hs:684:26: Warning: Use string literal
Found
Found
['p']Why not
"p"
src/Darcs/Arguments.hs:686:28: Warning: Use string literal
Found
Found
['p']Why not
"p"
src/Darcs/Arguments.hs:700:26: Warning: Use string literal
Found
Found
['n']Why not
"n"
src/Darcs/Arguments.hs:705:28: Warning: Use string literal
Found
Found
['n']Why not
"n"
src/Darcs/Arguments.hs:761:23: Warning: Use string literal
Found
Found
['l']Why not
"l"
src/Darcs/Arguments.hs:801:18: Warning: Use string literal
Found
Found
['A']Why not
"A"
src/Darcs/Arguments.hs:897:29: Warning: Use string literal
Found
Found
['s']Why not
"s"
src/Darcs/Arguments.hs:900:29: Warning: Use string literal
Found
Found
['u']Why not
"u"
src/Darcs/Arguments.hs:906:29: Warning: Use string literal
Found
Found
['u']Why not
"u"
src/Darcs/Arguments.hs:977:54: Warning: Use string literal
Found
Found
['o']Why not
"o"
src/Darcs/Arguments.hs:981:42: Warning: Use string literal
Found
Found
['O']Why not
"O"
src/Darcs/Arguments.hs:1000:18: Warning: Use string literal
Found
Found
['d']Why not
"d"
src/Darcs/Arguments.hs:1005:25: Warning: Use string literal
Found
Found
['r']Why not
"r"
src/Darcs/Arguments.hs:1107:35: Warning: Use string literal
Found
Found
['f']Why not
"f"
src/Darcs/Arguments.hs:1169:11: Warning: Redundant $
Found
Found
putDocLn $ put_modeWhy not
putDocLn put_mode
src/Darcs/Arguments.hs:1170:21: Warning: Redundant $
Found
Found
text $ ""Why not
text ""
src/Darcs/Arguments.hs:1171:21: Warning: Redundant $
Found
Found
text $ "Making no changes: this is a dry run."Why not
text "Making no changes: this is a dry run."
src/Darcs/Arguments.hs:1175:11: Warning: Redundant $
Found
Found
putDocLn $ put_modeWhy not
putDocLn put_mode
src/Darcs/Arguments.hs:1176:23: Warning: Redundant bracket
Found
Found
if XMLOutput `elem` opts then (text "<patches>" $$ vcat (mapFL (indent . xml_info) patches) $$ text "</patches>") else (vsep $ mapFL (showFriendly opts) patches)Why not
if XMLOutput `elem` opts then text "<patches>" $$ vcat (mapFL (indent . xml_info) patches) $$ text "</patches>" else (vsep $ mapFL (showFriendly opts) patches)
src/Darcs/Arguments.hs:1176:23: Warning: Redundant bracket
Found
Found
if XMLOutput `elem` opts then (text "<patches>" $$ vcat (mapFL (indent . xml_info) patches) $$ text "</patches>") else (vsep $ mapFL (showFriendly opts) patches)Why not
if XMLOutput `elem` opts then (text "<patches>" $$ vcat (mapFL (indent . xml_info) patches) $$ text "</patches>") else vsep $ mapFL (showFriendly opts) patches
src/Darcs/Arguments.hs:1213:17: Warning: Redundant $
Found
Found
concatOptions $ [DarcsMultipleChoiceOption [DarcsNoArgOption [] ["context"] GenContext "give output suitable for get --context"], xmloutput, humanReadable, DarcsMultipleChoiceOption [DarcsNoArgOption [] ["number"] NumberPatches "number the changes", DarcsNoArgOption [] ["count"] Count "output count of changes"]]Why not
concatOptions [DarcsMultipleChoiceOption [DarcsNoArgOption [] ["context"] GenContext "give output suitable for get --context"], xmloutput, humanReadable, DarcsMultipleChoiceOption [DarcsNoArgOption [] ["number"] NumberPatches "number the changes", DarcsNoArgOption [] ["count"] Count "output count of changes"]]
src/Darcs/Arguments.hs:1249:22: Warning: Use string literal
Found
Found
['i']Why not
"i"
src/Darcs/Arguments.hs:1254:20: Warning: Use string literal
Found
Found
['a']Why not
"a"
src/Darcs/Arguments.hs:1313:30: Warning: Use :
Found
Found
" " ++ argWhy not
' ' : arg
src/Darcs/Arguments.hs:1316:30: Warning: Use :
Found
Found
" " ++ argWhy not
' ' : arg
src/Darcs/Arguments.hs:1319:30: Warning: Use :
Found
Found
" " ++ argWhy not
' ' : arg
src/Darcs/Arguments.hs:1324:21: Warning: Use String
Found
Found
[Char] -> StringWhy not
String -> String
src/Darcs/Arguments.hs:1370:18: Warning: Redundant bracket
Found
Found
(Sibling s) : lWhy not
Sibling s : l
src/Darcs/Arguments.hs:1370:37: Warning: Redundant bracket
Found
Found
s : (flagsToSiblings l)Why not
s : flagsToSiblings l
src/Darcs/Arguments.hs:1431:49: Warning: Use string literal
Found
Found
['0']Why not
"0"
src/Darcs/Bug.hs:26:3: Warning: Use fromMaybe
Found
Found
case mx of Nothing -> _bug bs $ "fromJust error at " ++ _bugLoc bs Just x -> xWhy not
fromMaybe (_bug bs $ "fromJust error at " ++ _bugLoc bs) mx
src/Darcs/Utils.hs:281:38: Warning: Use string literal
Found
Found
['\\', '"']Why not
"\\\""
src/Darcs/Utils.hs:359:56: Warning: Use String
Found
Found
[Char]Why not
String
src/Darcs/Utils.hs:360:59: Warning: Use String
Found
Found
[Char]Why not
String
src/Darcs/Utils.hs:362:48: Warning: Use String
Found
Found
[Char]Why not
String
src/Darcs/Utils.hs:367:15: Warning: Use String
Found
Found
[Char] -> IO BoolWhy not
String -> IO Bool
src/Darcs/Utils.hs:434:44: Error: Redundant do
Found
Found
do do wd <- currentDirectory Just tree <- gets (flip findTree wd . HS.tree) let subs = [AnchoredPath [Name n] | (Name n, _) <- listImmediate tree, BSC.map toLower n == BSC.map toLower x] or `fmap` forM subs (\ path -> do file <- fileExists path if file then return True else withDirectory path (existsAnycase $ AnchoredPath xs))Why not
do wd <- currentDirectory Just tree <- gets (flip findTree wd . HS.tree) let subs = [AnchoredPath [Name n] | (Name n, _) <- listImmediate tree, BSC.map toLower n == BSC.map toLower x] or `fmap` forM subs (\ path -> do file <- fileExists path if file then return True else withDirectory path (existsAnycase $ AnchoredPath xs))
src/Darcs/Utils.hs:472:21: Error: Redundant do
Found
Found
do return ()Why not
return ()
src/Darcs/Utils.hs:503:25: Warning: Redundant bracket
Found
Found
case (normalizeEncoding codeName) of "ascii" -> True "646" -> True "ansi_x3_4_1968" -> True "ansi_x3.4_1986" -> True "cp367" -> True "csascii" -> True "ibm367" -> True "iso646_us" -> True "iso_646.irv_1991" -> True "iso_ir_6" -> True "us" -> True "us_ascii" -> True "utf_8" -> True "u8" -> True "utf" -> True "utf8" -> True "utf8_ucs2" -> True "utf8_ucs4" -> True _ -> FalseWhy not
case normalizeEncoding codeName of "ascii" -> True "646" -> True "ansi_x3_4_1968" -> True "ansi_x3.4_1986" -> True "cp367" -> True "csascii" -> True "ibm367" -> True "iso646_us" -> True "iso_646.irv_1991" -> True "iso_ir_6" -> True "us" -> True "us_ascii" -> True "utf_8" -> True "u8" -> True "utf" -> True "utf8" -> True "utf8_ucs2" -> True "utf8_ucs4" -> True _ -> False
src/Darcs/SignalHandler.hs:56:4: Error: Eta reduce
Found
Found
toException e = SomeException eWhy not
toException = SomeException
src/Darcs/SignalHandler.hs:68:50: Warning: Redundant $
Found
Found
ExitFailure $ 1Why not
ExitFailure 1
src/Darcs/SignalHandler.hs:70:25: Warning: Redundant $
Found
Found
hPutStrLn stderr $ ("withSignalsHandled: " ++ s)Why not
hPutStrLn stderr ("withSignalsHandled: " ++ s)
src/Darcs/SignalHandler.hs:73:36: Warning: Redundant $
Found
Found
ExitFailure $ 1Why not
ExitFailure 1
src/Darcs/SignalHandler.hs:76:20: Error: Use unless
Found
Found
when (not is_pipe)Why not
unless is_pipe
src/Darcs/SignalHandler.hs:78:31: Warning: Redundant $
Found
Found
ExitFailure $ 2Why not
ExitFailure 2
src/Darcs/SignalHandler.hs:80:45: Warning: Redundant $
Found
Found
ExitFailure $ 2Why not
ExitFailure 2
src/Darcs/Resolution.hs:86:6: Error: Eta reduce
Found
Found
effectOnFPs ps fps = effectOnFilePaths ps fpsWhy not
effectOnFPs = effectOnFilePaths
src/Darcs/PrintPatch.hs:37:54: Warning: Redundant bracket
Found
Found
(Maybe (Tree IO)) -> [DarcsFlag] -> p wX wY -> IO ()Why not
Maybe (Tree IO) -> [DarcsFlag] -> p wX wY -> IO ()
src/Darcs/Commands/Record.hs:172:9: Error: Use when
Found
Found
if (oneLetterName && (All `notElem` opts)) then do confirmed <- promptYorn $ "You specified " ++ show n ++ " as the patch name. Is that really what you want?" unless confirmed $ do putStrLn "Okay, aborting the record." exitFailure else return ()Why not
(when (oneLetterName && (All `notElem` opts)) $ do confirmed <- promptYorn $ "You specified " ++ show n ++ " as the patch name. Is that really what you want?" unless confirmed $ do putStrLn "Okay, aborting the record." exitFailure)
src/Darcs/Commands/Record.hs:172:9: Warning: Redundant bracket
Found
Found
if (oneLetterName && (All `notElem` opts)) then do confirmed <- promptYorn $ "You specified " ++ show n ++ " as the patch name. Is that really what you want?" unless confirmed $ do putStrLn "Okay, aborting the record." exitFailure else return ()Why not
if oneLetterName && (All `notElem` opts) then do confirmed <- promptYorn $ "You specified " ++ show n ++ " as the patch name. Is that really what you want?" unless confirmed $ do putStrLn "Okay, aborting the record." exitFailure else return ()
src/Darcs/Commands/Record.hs:226:22: Error: Use unless
Found
Found
when (not $ isInteractive opts)Why not
unless (isInteractive opts)
src/Darcs/Commands/Record.hs:268:23: Error: Redundant do
Found
Found
do cleanLocalDate `fmap` askUser "What is the date? "Why not
cleanLocalDate `fmap` askUser "What is the date? "
src/Darcs/Commands/Record.hs:389:56: Warning: Redundant bracket
Found
Found
(reverseRL x) +>+ (pa :>: NilFL)Why not
reverseRL x +>+ (pa :>: NilFL)
src/Darcs/Commands/Record.hs:392:46: Warning: Redundant bracket
Found
Found
pa `unsafeCompare` (tpPatch tp)Why not
pa `unsafeCompare` tpPatch tp
src/Darcs/Commands/Move.hs:90:7: Warning: Redundant $
Found
Found
fail $ "The `darcs move' command requires at least two arguments."Why not
fail "The `darcs move' command requires at least two arguments."
src/Darcs/Commands/Move.hs:216:30: Warning: Redundant $
Found
Found
(fn2fp $ superName $ fp2fn new) ++ " isn't known in working directory, did you forget to add it?"Why not
fn2fp (superName $ fp2fn new) ++ " isn't known in working directory, did you forget to add it?"
src/Darcs/Commands/Move.hs:228:30: Error: Redundant bracket
Found
Found
(add_patch)Why not
add_patch
src/Darcs/Commands/Move.hs:232:6: Warning: Redundant $
Found
Found
(fn2fp $ superName $ fp2fn new) ++ " isn't known in working directory, did you forget to add it?"Why not
fn2fp (superName $ fp2fn new) ++ " isn't known in working directory, did you forget to add it?"
src/Darcs/Commands/Changes.hs:141:35: Error: Use notElem
Found
Found
not (XMLOutput `elem` opts)Why not
notElem XMLOutput opts
src/Darcs/Commands/Changes.hs:193:21: Warning: Redundant $
Found
Found
Sealed $ psWhy not
Sealed ps
src/Darcs/Commands/Changes.hs:213:29: Warning: Use uncurry
Found
Found
\ (a, b) -> a /= bWhy not
uncurry (/=)
src/Darcs/Commands/Changes.hs:232:63: Error: Redundant do
Found
Found
do return ([(s2hp, affected)], renames', Nothing)Why not
return ([(s2hp, affected)], renames', Nothing)
src/Darcs/Commands/Changes.hs:235:48: Warning: Redundant bracket
Found
Found
(subtract 1) <$> cWhy not
subtract 1 <$> c
src/Darcs/Commands/Changes.hs:290:42: Warning: Redundant bracket
Found
Found
toXml . (unseal2 info)Why not
toXml . unseal2 info
src/Darcs/Commands/ShowFiles.hs:92:27: Warning: Redundant $
Found
Found
"." : (map (anchorPath "." . fst) $ list t)Why not
"." : map (anchorPath "." . fst) (list t)
src/Darcs/Commands/ShowFiles.hs:98:36: Error: Redundant do
Found
Found
do mapM_ output =<< manifestHelper to_list opts argListWhy not
mapM_ output =<< manifestHelper to_list opts argList
src/Darcs/Commands/ShowFiles.hs:106:14: Warning: Redundant bracket
Found
Found
(to_list opts) `fmap` withRepository opts (RepoJob myslurp)Why not
to_list opts `fmap` withRepository opts (RepoJob myslurp)
src/Darcs/Commands/ShowFiles.hs:117:46: Warning: Redundant $
Found
Found
error $ "can't mix revisioned and pending flags"Why not
error "can't mix revisioned and pending flags"
src/Darcs/Commands/ShowFiles.hs:120:50: Warning: Redundant $
Found
Found
error $ "can't mix pending and no-pending flags"Why not
error "can't mix pending and no-pending flags"
src/Darcs/Commands/Unrecord.hs:118:22: Warning: Redundant bracket
Found
Found
(PatchSet p) :> (FL (PatchInfoAnd p))Why not
PatchSet p :> (FL (PatchInfoAnd p))
src/Darcs/Commands/Unrecord.hs:118:22: Warning: Redundant bracket
Found
Found
(PatchSet p) :> (FL (PatchInfoAnd p))Why not
(PatchSet p) :> FL (PatchInfoAnd p)
src/Darcs/Commands/Unrecord.hs:228:5: Warning: Redundant bracket
Found
Found
case mh set of (start :> patches) -> (start :> reverseRL patches)Why not
case mh set of (start :> patches) -> start :> reverseRL patches
src/Darcs/Commands/Unrecord.hs:236:13: Warning: Redundant bracket
Found
Found
case mh (PatchSet (t :<: ps) ts) of (start :> patches) -> (start :> x +<+ patches)Why not
case mh (PatchSet (t :<: ps) ts) of (start :> patches) -> start :> x +<+ patches
src/Darcs/Commands/Unrecord.hs:238:15: Warning: Redundant bracket
Found
Found
(ps :> NilRL)Why not
ps :> NilRL
src/Darcs/Commands/Unrecord.hs:247:5: Warning: Redundant $
Found
Found
useAbsoluteOrStd writeDocBinFile putDoc outname $ bundleWhy not
useAbsoluteOrStd writeDocBinFile putDoc outname bundle
src/Darcs/Commands/ShowIndex.hs:77:64: Error: Redundant do
Found
Found
do readIndex repo >>= updateIndex >>= dump optsWhy not
readIndex repo >>= updateIndex >>= dump opts
src/Darcs/Commands/ShowIndex.hs:81:67: Error: Redundant do
Found
Found
do readRecorded repo >>= dump optsWhy not
readRecorded repo >>= dump opts
src/Darcs/Commands/AmendRecord.hs:191:77: Error: Redundant do
Found
Found
do withSelectedPatchFromRepo "amend" repository opts $ \ (_ :> oldp) -> do announceFiles files "Amending changes in" pristine <- readRecorded repository let go :: forall wU1 . FL (PrimOf p) wR wU1 -> IO () go NilFL | not (hasEditMetadata opts) = putStrLn "No changes!" go ch = do let context = selectionContextPrim "add" (intersect [All, Unified] opts) (Just primSplitter) (map toFilePath <$> files) (Just pristine) (chosenPatches :> _) <- runSelection (selectChanges First ch) context addChangesToPatch opts repository oldp chosenPatches if not (isTag (info oldp)) then if removeFromAmended opts then do let sel = selectChanges Last (effect oldp) context = selectionContextPrim "unrecord" (intersect [All, Unified] opts) (Just primSplitter) (map toFilePath <$> files) (Just pristine) (_ :> chosenPrims) <- runSelection sel context let invPrims = reverseRL (invertFL chosenPrims) addChangesToPatch opts repository oldp invPrims else go =<< unrecordedChanges (diffingOpts opts) repository files else if hasEditMetadata opts && isNothing files then go NilFL else do if hasEditMetadata opts then putStrLn "You cannot add new changes to a tag." else putStrLn "You cannot add new changes to a tag, but you are allowed to edit tag's metadata (see darcs help amend-record)." go NilFLWhy not
withSelectedPatchFromRepo "amend" repository opts $ \ (_ :> oldp) -> do announceFiles files "Amending changes in" pristine <- readRecorded repository let go :: forall wU1 . FL (PrimOf p) wR wU1 -> IO () go NilFL | not (hasEditMetadata opts) = putStrLn "No changes!" go ch = do let context = selectionContextPrim "add" (intersect [All, Unified] opts) (Just primSplitter) (map toFilePath <$> files) (Just pristine) (chosenPatches :> _) <- runSelection (selectChanges First ch) context addChangesToPatch opts repository oldp chosenPatches if not (isTag (info oldp)) then if removeFromAmended opts then do let sel = selectChanges Last (effect oldp) context = selectionContextPrim "unrecord" (intersect [All, Unified] opts) (Just primSplitter) (map toFilePath <$> files) (Just pristine) (_ :> chosenPrims) <- runSelection sel context let invPrims = reverseRL (invertFL chosenPrims) addChangesToPatch opts repository oldp invPrims else go =<< unrecordedChanges (diffingOpts opts) repository files else if hasEditMetadata opts && isNothing files then go NilFL else do if hasEditMetadata opts then putStrLn "You cannot add new changes to a tag." else putStrLn "You cannot add new changes to a tag, but you are allowed to edit tag's metadata (see darcs help amend-record)." go NilFL
src/Darcs/Commands/AmendRecord.hs:200:40: Warning: Use infix
Found
Found
intersect [All, Unified] optsWhy not
[All, Unified] `intersect` opts
src/Darcs/Commands/AmendRecord.hs:211:47: Warning: Use infix
Found
Found
intersect [All, Unified] optsWhy not
[All, Unified] `intersect` opts
src/Darcs/Commands/AmendRecord.hs:241:5: Warning: Redundant bracket
Found
Found
if (nullFL chs && not (hasEditMetadata opts)) then putStrLn "You don't want to record anything!" else do invalidateIndex repository withGutsOf repository $ do repository' <- tentativelyRemovePatches repository (compression opts) (oldp :>: NilFL) (mlogf, newp) <- updatePatchHeader opts repository' oldp chs setEnvDarcsFiles newp repository'' <- tentativelyAddPatch repository' (compression opts) newp let failmsg = maybe "" (\ lf -> "\nLogfile left in " ++ lf ++ ".") mlogf rc <- testTentative repository when (rc /= ExitSuccess) $ do when (not $ isInteractive opts) $ exitWith rc `clarifyErrors` failmsg putStrLn $ "Looks like you have a bad patch: '" ++ patchDesc newp ++ "'" let prompt = "Shall I amend it anyway?" yn <- promptChar (PromptConfig prompt "yn" [] (Just 'n') []) case yn of 'y' -> return () _ -> exitWith rc `clarifyErrors` failmsg finalizeRepositoryChanges repository'' `clarifyErrors` failmsg maybe (return ()) removeFile mlogf putStrLn "Finished amending patch:" putDocLn $ description newpWhy not
if nullFL chs && not (hasEditMetadata opts) then putStrLn "You don't want to record anything!" else do invalidateIndex repository withGutsOf repository $ do repository' <- tentativelyRemovePatches repository (compression opts) (oldp :>: NilFL) (mlogf, newp) <- updatePatchHeader opts repository' oldp chs setEnvDarcsFiles newp repository'' <- tentativelyAddPatch repository' (compression opts) newp let failmsg = maybe "" (\ lf -> "\nLogfile left in " ++ lf ++ ".") mlogf rc <- testTentative repository when (rc /= ExitSuccess) $ do when (not $ isInteractive opts) $ exitWith rc `clarifyErrors` failmsg putStrLn $ "Looks like you have a bad patch: '" ++ patchDesc newp ++ "'" let prompt = "Shall I amend it anyway?" yn <- promptChar (PromptConfig prompt "yn" [] (Just 'n') []) case yn of 'y' -> return () _ -> exitWith rc `clarifyErrors` failmsg finalizeRepositoryChanges repository'' `clarifyErrors` failmsg maybe (return ()) removeFile mlogf putStrLn "Finished amending patch:" putDocLn $ description newp
src/Darcs/Commands/AmendRecord.hs:254:16: Error: Use unless
Found
Found
when (not $ isInteractive opts)Why not
unless (isInteractive opts)
src/Darcs/Commands/AmendRecord.hs:289:22: Warning: Use fromMaybe
Found
Found
case getAuthor opts of Just a -> a Nothing -> piAuthor old_pinfWhy not
(fromMaybe (piAuthor old_pinf) (getAuthor opts))
src/Darcs/Commands/Add.hs:157:48: Error: Use notElem
Found
Found
not (Quiet `elem` opts)Why not
notElem Quiet opts
src/Darcs/Commands/Rollback.hs:79:16: Warning: Redundant $
Found
Found
unlines $ ["Rollback is used to undo the effects of some changes from patches", "in the repository. The selected changes are undone in your working", "copy, but the repository is left unchanged. First you are offered a", "choice of which patches to undo, then which changes within the", "patches to undo. Optionally, you can have darcs record this undo", "straight away, as an explicit \"rollback patch\". In both cases\n " ++ ", rollback is perfectly safe, unlike obliterate, as you keep all", "previous patches intact.\n"]Why not
unlines ["Rollback is used to undo the effects of some changes from patches", "in the repository. The selected changes are undone in your working", "copy, but the repository is left unchanged. First you are offered a", "choice of which patches to undo, then which changes within the", "patches to undo. Optionally, you can have darcs record this undo", "straight away, as an explicit \"rollback patch\". In both cases\n " ++ ", rollback is perfectly safe, unlike obliterate, as you keep all", "previous patches intact.\n"]
src/Darcs/Commands/Rollback.hs:122:35: Warning: Redundant bracket
Found
Found
(PatchSet NilRL NilRL) :> (newset2FL allpatches)Why not
PatchSet NilRL NilRL :> (newset2FL allpatches)
src/Darcs/Commands/Rollback.hs:122:35: Warning: Redundant bracket
Found
Found
(PatchSet NilRL NilRL) :> (newset2FL allpatches)Why not
(PatchSet NilRL NilRL) :> newset2FL allpatches
src/Darcs/Commands/Rollback.hs:131:16: Warning: Redundant bracket
Found
Found
if (doRecordRollback opts) then (rollItBackNow opts repository ps) else (undoItNow opts repository)Why not
if doRecordRollback opts then (rollItBackNow opts repository ps) else (undoItNow opts repository)
src/Darcs/Commands/Rollback.hs:131:16: Warning: Redundant bracket
Found
Found
if (doRecordRollback opts) then (rollItBackNow opts repository ps) else (undoItNow opts repository)Why not
if (doRecordRollback opts) then rollItBackNow opts repository ps else (undoItNow opts repository)
src/Darcs/Commands/Rollback.hs:131:16: Warning: Redundant bracket
Found
Found
if (doRecordRollback opts) then (rollItBackNow opts repository ps) else (undoItNow opts repository)Why not
if (doRecordRollback opts) then (rollItBackNow opts repository ps) else undoItNow opts repository
src/Darcs/Commands/Rollback.hs:158:17: Error: Use unless
Found
Found
when (not $ isInteractive opts)Why not
unless (isInteractive opts)
src/Darcs/Commands/Optimize.hs:282:5: Error: Use .
Found
Found
mapM_ (maybeRelinkFile src) (map ((dir ++ "/") ++) dst)Why not
mapM_ (maybeRelinkFile src . ((dir ++ "/") ++)) dst
src/Darcs/Commands/GZCRCs.hs:48:1: Error: Use fewer imports
Found
Found
import ByteStringUtils (isGZFile) import ByteStringUtils (gzDecompress)Why not
import ByteStringUtils (isGZFile, gzDecompress)
src/Darcs/Commands/GZCRCs.hs:109:4: Error: Use unless
Found
Found
when (not . null $ files)Why not
unless (null files)
src/Darcs/Commands/GZCRCs.hs:146:41: Warning: Use forM_
Found
Found
flip mapM_Why not
Control.Monad.forM_
src/Darcs/Commands/GZCRCs.hs:146:67: Error: Redundant do
Found
Found
do unless (JustThisRepo `elem` opts && not (isthisrepo loc)) $ do let w = writable loc flip mapM_ allHashedDirs $ \ hdir -> do let dir = hashedFilePath loc hdir "" exists <- liftIO $ doesDirectoryExist dir when exists $ do liftIO $ do warn <- readIORef warnRelatedRepos when (warn && not (isthisrepo loc)) $ do writeIORef warnRelatedRepos False putInfo $ text "Also checking related repos and caches; use --just-this-repo to disable." liftIO $ putInfo $ text $ "Checking " ++ dir ++ (if w then "" else " (readonly)") files <- liftIO $ getDirectoryContents dir ((), Sum count) <- runWriterT $ flip mapM_ files $ \ file -> do let fn = dir ++ file isfile <- liftIO $ doesFileExist fn when isfile $ do gz <- liftIO $ isGZFile fn case gz of Nothing -> return () Just len -> do contents <- liftIO $ B.readFile fn let (uncompressed, isCorrupt) = gzDecompress (Just len) . BL.fromChunks $ [contents] when isCorrupt $ do tell (Sum 1) liftIO $ putVerbose $ text $ "Corrupt: " ++ fn when (w && Repair `elem` opts) $ liftIO $ gzWriteAtomicFilePSs fn uncompressed when (count > (0 :: Int)) $ do liftIO $ putInfo $ text $ "Found " ++ show count ++ " corrupt file" ++ (if count > 1 then "s" else "") ++ (if Repair `elem` opts then (if w then " (repaired)" else " (not repaired") else "") tell (Any True)Why not
unless (JustThisRepo `elem` opts && not (isthisrepo loc)) $ do let w = writable loc flip mapM_ allHashedDirs $ \ hdir -> do let dir = hashedFilePath loc hdir "" exists <- liftIO $ doesDirectoryExist dir when exists $ do liftIO $ do warn <- readIORef warnRelatedRepos when (warn && not (isthisrepo loc)) $ do writeIORef warnRelatedRepos False putInfo $ text "Also checking related repos and caches; use --just-this-repo to disable." liftIO $ putInfo $ text $ "Checking " ++ dir ++ (if w then "" else " (readonly)") files <- liftIO $ getDirectoryContents dir ((), Sum count) <- runWriterT $ flip mapM_ files $ \ file -> do let fn = dir ++ file isfile <- liftIO $ doesFileExist fn when isfile $ do gz <- liftIO $ isGZFile fn case gz of Nothing -> return () Just len -> do contents <- liftIO $ B.readFile fn let (uncompressed, isCorrupt) = gzDecompress (Just len) . BL.fromChunks $ [contents] when isCorrupt $ do tell (Sum 1) liftIO $ putVerbose $ text $ "Corrupt: " ++ fn when (w && Repair `elem` opts) $ liftIO $ gzWriteAtomicFilePSs fn uncompressed when (count > (0 :: Int)) $ do liftIO $ putInfo $ text $ "Found " ++ show count ++ " corrupt file" ++ (if count > 1 then "s" else "") ++ (if Repair `elem` opts then (if w then " (repaired)" else " (not repaired") else "") tell (Any True)
src/Darcs/Commands/GZCRCs.hs:149:6: Warning: Use forM_
Found
Found
flip mapM_Why not
Control.Monad.forM_
src/Darcs/Commands/GZCRCs.hs:160:44: Warning: Use forM_
Found
Found
flip mapM_Why not
Control.Monad.forM_
src/Darcs/Commands/GZCRCs.hs:182:18: Error: Use unless
Found
Found
when (not $ Quiet `elem` opts)Why not
unless (Quiet `elem` opts)
src/Darcs/Commands/GZCRCs.hs:182:24: Error: Use notElem
Found
Found
not $ Quiet `elem` optsWhy not
notElem Quiet opts
src/Darcs/Commands/Annotate.hs:18:1: Error: Use better pragmas
Found
Found
{-# OPTIONS_GHC -cpp #-}
Why not remove it.
src/Darcs/Commands/Annotate.hs:100:3: Error: Use unless
Found
Found
when (not $ haveNonrangeMatch opts)Why not
unless (haveNonrangeMatch opts)
src/Darcs/Commands/Annotate.hs:134:16: Warning: Redundant $
Found
Found
return $ (seal $ newset2RL x, initial, toFilePath path)Why not
return (seal $ newset2RL x, initial, toFilePath path)
src/Darcs/Commands/Annotate.hs:135:13: Warning: Redundant $
Found
Found
return $ (seal $ newset2RL r, recorded, toFilePath origpath)Why not
return (seal $ newset2RL r, recorded, toFilePath origpath)
src/Darcs/Commands/Annotate.hs:147:45: Error: Use map once
Found
Found
map showPath $ map (\ (x, y) -> (anchorPath "" x, y)) $ list s'Why not
map (showPath . (\ (x, y) -> (anchorPath "" x, y))) (list s')
src/Darcs/Commands/Annotate.hs:148:30: Warning: Use first
Found
Found
\ (x, y) -> (anchorPath "" x, y)Why not
Control.Arrow.first (anchorPath "")
src/Darcs/Commands/Diff.hs:31:1: Error: Use fewer imports
Found
Found
import Darcs.External (diffProgram) import Darcs.External (execPipeIgnoreError)Why not
import Darcs.External (diffProgram, execPipeIgnoreError)
src/Darcs/Commands/Diff.hs:147:24: Warning: Redundant $
Found
Found
bug $ "parseCmd should never return empty list"Why not
bug "parseCmd should never return empty list"
src/Darcs/Commands/Diff.hs:148:11: Warning: Redundant bracket
Found
Found
((h : t), _)Why not
(h : t, _)
src/Darcs/Commands/Diff.hs:150:11: Warning: Redundant bracket
Found
Found
(cmd, ("-rN" : getDiffOpts opts ++ [f1, f2]))Why not
(cmd, "-rN" : getDiffOpts opts ++ [f1, f2])
src/Darcs/Commands/Diff.hs:165:72: Warning: Use let
Found
Found
do formerdir <- getCurrentDirectory thename <- return $ takeFileName formerdir patchset <- readRepo repository unrecorded <- fromPrims `fmap` unrecordedChanges (UseIndex, ScanKnown) repository msubpaths unrecorded' <- n2pia `fmap` anonymous unrecorded Sealed all <- return $ case (secondMatch opts, patchset) of (True, _) -> seal patchset (False, (PatchSet untagged tagged)) -> seal $ PatchSet (unrecorded' :<: untagged) tagged Sealed ctx <- return $ if firstMatch opts then matchFirstPatchset opts patchset else seal patchset Sealed match <- return $ if secondMatch opts then matchSecondPatchset opts patchset else seal all (_ :> todiff) <- return $ findCommonWithThem match ctx (_ :> tounapply) <- return $ findCommonWithThem all match base <- if secondMatch opts then readRecorded repository else readUnrecorded repository Nothing let touched = map (fromJust . simpleSubPath) $ listTouchedFiles todiff files = case msubpaths of Nothing -> touched Just subpaths -> concatMap (\ s -> filter (isSubPathOf s) touched) subpaths relevant <- restrictSubpaths repository files let filt = applyTreeFilter relevant . snd ppath = darcsdir </> "pristine.hashed" oldtree <- filt `fmap` hashedTreeIO (apply . invert $ unsafeCoercePEnd todiff +>+ tounapply) base ppath newtree <- filt `fmap` hashedTreeIO (apply . invert $ tounapply) base ppath withTempDir ("old-" ++ thename) $ \ odir -> do withTempDir ("new-" ++ thename) $ \ ndir -> do withCurrentDirectory formerdir $ do writePlainTree oldtree (toFilePath odir) writePlainTree newtree (toFilePath ndir) thediff <- withCurrentDirectory (toFilePath odir ++ "/..") $ rundiff (takeFileName $ toFilePath odir) (takeFileName $ toFilePath ndir) morepatches <- readRepo repository putDoc $ changelog (getDiffInfo opts morepatches) $$ thediffWhy not
do formerdir <- getCurrentDirectory let thename = takeFileName formerdir patchset <- readRepo repository unrecorded <- fromPrims `fmap` unrecordedChanges (UseIndex, ScanKnown) repository msubpaths unrecorded' <- n2pia `fmap` anonymous unrecorded Sealed all <- return $ case (secondMatch opts, patchset) of (True, _) -> seal patchset (False, (PatchSet untagged tagged)) -> seal $ PatchSet (unrecorded' :<: untagged) tagged Sealed ctx <- return $ if firstMatch opts then matchFirstPatchset opts patchset else seal patchset Sealed match <- return $ if secondMatch opts then matchSecondPatchset opts patchset else seal all (_ :> todiff) <- return $ findCommonWithThem match ctx (_ :> tounapply) <- return $ findCommonWithThem all match base <- if secondMatch opts then readRecorded repository else readUnrecorded repository Nothing let touched = map (fromJust . simpleSubPath) $ listTouchedFiles todiff files = case msubpaths of Nothing -> touched Just subpaths -> concatMap (\ s -> filter (isSubPathOf s) touched) subpaths relevant <- restrictSubpaths repository files let filt = applyTreeFilter relevant . snd ppath = darcsdir </> "pristine.hashed" oldtree <- filt `fmap` hashedTreeIO (apply . invert $ unsafeCoercePEnd todiff +>+ tounapply) base ppath newtree <- filt `fmap` hashedTreeIO (apply . invert $ tounapply) base ppath withTempDir ("old-" ++ thename) $ \ odir -> do withTempDir ("new-" ++ thename) $ \ ndir -> do withCurrentDirectory formerdir $ do writePlainTree oldtree (toFilePath odir) writePlainTree newtree (toFilePath ndir) thediff <- withCurrentDirectory (toFilePath odir ++ "/..") $ rundiff (takeFileName $ toFilePath odir) (takeFileName $ toFilePath ndir) morepatches <- readRepo repository putDoc $ changelog (getDiffInfo opts morepatches) $$ thediff
src/Darcs/Commands/Diff.hs:177:5: Warning: Redundant bracket
Found
Found
(False, (PatchSet untagged tagged))Why not
(False, PatchSet untagged tagged)
src/Darcs/Commands/Diff.hs:205:44: Error: Redundant do
Found
Found
do withTempDir ("new-" ++ thename) $ \ ndir -> do withCurrentDirectory formerdir $ do writePlainTree oldtree (toFilePath odir) writePlainTree newtree (toFilePath ndir) thediff <- withCurrentDirectory (toFilePath odir ++ "/..") $ rundiff (takeFileName $ toFilePath odir) (takeFileName $ toFilePath ndir) morepatches <- readRepo repository putDoc $ changelog (getDiffInfo opts morepatches) $$ thediffWhy not
withTempDir ("new-" ++ thename) $ \ ndir -> do withCurrentDirectory formerdir $ do writePlainTree oldtree (toFilePath odir) writePlainTree newtree (toFilePath ndir) thediff <- withCurrentDirectory (toFilePath odir ++ "/..") $ rundiff (takeFileName $ toFilePath odir) (takeFileName $ toFilePath ndir) morepatches <- readRepo repository putDoc $ changelog (getDiffInfo opts morepatches) $$ thediff
src/Darcs/Commands/Diff.hs:206:46: Error: Redundant do
Found
Found
do withCurrentDirectory formerdir $ do writePlainTree oldtree (toFilePath odir) writePlainTree newtree (toFilePath ndir) thediff <- withCurrentDirectory (toFilePath odir ++ "/..") $ rundiff (takeFileName $ toFilePath odir) (takeFileName $ toFilePath ndir) morepatches <- readRepo repository putDoc $ changelog (getDiffInfo opts morepatches) $$ thediffWhy not
withCurrentDirectory formerdir $ do writePlainTree oldtree (toFilePath odir) writePlainTree newtree (toFilePath ndir) thediff <- withCurrentDirectory (toFilePath odir ++ "/..") $ rundiff (takeFileName $ toFilePath odir) (takeFileName $ toFilePath ndir) morepatches <- readRepo repository putDoc $ changelog (getDiffInfo opts morepatches) $$ thediff
src/Darcs/Commands/TransferMode.hs:18:1: Error: Unused LANGUAGE pragma
Found
Found
{-# LANGUAGE CPP, PatternGuards #-}
Why not{-# LANGUAGE CPP #-}
src/Darcs/Commands/TransferMode.hs:69:28: Warning: Redundant $
Found
Found
withCurrentDirectory darcsdir $ transferWhy not
withCurrentDirectory darcsdir transfer
src/Darcs/Commands/TransferMode.hs:85:53: Warning: Avoid lambda
Found
Found
\ e -> return $ Left (prettyException e)Why not
return . Left . prettyException
src/Darcs/Commands/Remove.hs:131:66: Error: Redundant do
Found
Found
do if not $ null (list unrecordedChildren) then skipAndWarn "it is not empty" else return $ Just $ freeGap (rmdir f_fp :>: NilFL)Why not
if not $ null (list unrecordedChildren) then skipAndWarn "it is not empty" else return $ Just $ freeGap (rmdir f_fp :>: NilFL)
src/Darcs/Commands/Remove.hs:146:16: Warning: Redundant $
Found
Found
return $ NothingWhy not
return Nothing
src/Darcs/Commands/Send.hs:22:1: Error: Use fewer imports
Found
Found
import System.Exit (exitWith, ExitCode(ExitSuccess)) import System.Exit (ExitCode(ExitFailure))Why not
import System.Exit (exitWith, ExitCode(ExitSuccess), ExitCode(ExitFailure))
src/Darcs/Commands/ShowRepo.hs:85:20: Warning: Redundant bracket
Found
Found
"num_" ++ (safeTag cs)Why not
"num_" ++ safeTag cs
src/Darcs/Commands/ShowRepo.hs:91:19: Warning: Redundant bracket
Found
Found
(replicate (14 - length (t)) ' ') ++ t ++ ": " ++ intercalate ('\n' : (replicate 16 ' ')) (lines i) ++ "\n"Why not
replicate (14 - length (t)) ' ' ++ t ++ ": " ++ intercalate ('\n' : (replicate 16 ' ')) (lines i) ++ "\n"
src/Darcs/Commands/ShowRepo.hs:91:42: Error: Redundant bracket
Found
Found
(t)Why not
t
src/Darcs/Commands/ShowRepo.hs:92:32: Warning: Redundant bracket
Found
Found
'\n' : (replicate 16 ' ')Why not
'\n' : replicate 16 ' '
src/Darcs/Commands/ShowRepo.hs:138:44: Warning: Redundant bracket
Found
Found
(p ++ " Pref", (dropWhile isSpace v))Why not
(p ++ " Pref", dropWhile isSpace v)
src/Darcs/Commands/ShowRepo.hs:146:16: Warning: Use fmap
Found
Found
readRepo r >>= (return . lengthRL . newset2RL)Why not
fmap (lengthRL . newset2RL) (readRepo r)
src/Darcs/Commands/Repair.hs:126:16: Warning: Use if
Found
Found
case willIgnoreTimes opts of False -> not <$> checkIndex repository (Quiet `elem` opts) True -> return FalseWhy not
(if willIgnoreTimes opts then return False else not <$> checkIndex repository (Quiet `elem` opts))
src/Darcs/Commands/Repair.hs:134:13: Warning: Redundant $
Found
Found
(fmap Just $ readRecorded repository) `catch` (\ _ -> return Nothing)Why not
fmap Just (readRecorded repository) `catch` (\ _ -> return Nothing)
src/Darcs/Commands/Revert.hs:98:13: Error: Redundant do
Found
Found
do withGutsOf repository $ do addToPending repository $ invert p when (Debug `elem` opts) $ putStrLn "About to write the unrevert file." case commute (norevert :> p) of Just (p' :> _) -> writeUnrevert repository p' rec NilFL Nothing -> writeUnrevert repository (norevert +>+ p) rec NilFL when (Debug `elem` opts) $ putStrLn "About to apply to the working directory." _ <- applyToWorking repository opts (invert p) `catch` \ e -> fail ("Unable to apply inverse patch!" ++ show e) return ()Why not
withGutsOf repository $ do addToPending repository $ invert p when (Debug `elem` opts) $ putStrLn "About to write the unrevert file." case commute (norevert :> p) of Just (p' :> _) -> writeUnrevert repository p' rec NilFL Nothing -> writeUnrevert repository (norevert +>+ p) rec NilFL when (Debug `elem` opts) $ putStrLn "About to apply to the working directory." _ <- applyToWorking repository opts (invert p) `catch` \ e -> fail ("Unable to apply inverse patch!" ++ show e) return ()
src/Darcs/Commands/Push.hs:112:36: Warning: Redundant $
Found
Found
putStrLn $ "Apply failed!"Why not
putStrLn "Apply failed!"
src/Darcs/Commands/Push.hs:118:71: Error: Redundant bracket
Found
Found
(Doc)Why not
Doc
src/Darcs/Commands/Push.hs:146:21: Warning: Redundant $
Found
Found
text "We have the following patches to push:" $$ (vcat $ mapRL description us')Why not
text "We have the following patches to push:" $$ vcat (mapRL description us')
src/Darcs/Commands/Push.hs:147:3: Error: Use unless
Found
Found
when (not $ nullRL us')Why not
unless (nullRL us')
src/Darcs/Commands/Push.hs:147:29: Error: Redundant do
Found
Found
do putInfo opts $ pull_reminderWhy not
putInfo opts $ pull_reminder
src/Darcs/Commands/Push.hs:147:32: Warning: Redundant $
Found
Found
putInfo opts $ pull_reminderWhy not
putInfo opts pull_reminder
src/Darcs/Commands/Push.hs:154:21: Error: Redundant bracket
Found
Found
(Doc)Why not
Doc
src/Darcs/Commands/Push.hs:165:14: Error: Redundant bracket
Found
Found
(bundle)Why not
bundle
src/Darcs/Commands/Push.hs:171:5: Warning: Redundant bracket
Found
Found
(SignAs _) : _Why not
SignAs _ : _
src/Darcs/Commands/Push.hs:172:5: Warning: Redundant bracket
Found
Found
(SignSSL _) : _Why not
SignSSL _ : _
src/Darcs/Commands/Push.hs:190:9: Error: Redundant do
Found
Found
do when (wantSign opts) $ abortRun opts $ text "Signing doesn't make sense for local repositories or when pushing over ssh."Why not
when (wantSign opts) $ abortRun opts $ text "Signing doesn't make sense for local repositories or when pushing over ssh."
src/Darcs/Commands/ShowTags.hs:73:19: Error: Use unless
Found
Found
if flag then return () else hPutStrLn stderr ("warning: tag with TAB character: " ++ t)Why not
(Control.Monad.unless flag $ hPutStrLn stderr ("warning: tag with TAB character: " ++ t))
src/Darcs/Commands/Tag.hs:98:41: Warning: Redundant bracket
Found
Found
if null a then o else (add_patch_name o (unwords a))Why not
if null a then o else add_patch_name o (unwords a)
src/Darcs/Commands/Tag.hs:106:42: Warning: Use :
Found
Found
[PatchName a] ++ oWhy not
(PatchName a) : o
src/Darcs/Commands/Pull.hs:76:1: Error: Use fewer imports
Found
Found
import Darcs.Patch.PatchInfoAnd (info, hopefully, patchDesc) import Darcs.Patch.PatchInfoAnd (PatchInfoAnd)Why not
import Darcs.Patch.PatchInfoAnd (info, hopefully, patchDesc, PatchInfoAnd)
src/Darcs/Commands/Pull.hs:81:1: Error: Use fewer imports
Found
Found
import Darcs.Patch.Set (Origin) import Darcs.Patch.Set (PatchSet(..), SealedPatchSet)Why not
import Darcs.Patch.Set (Origin, PatchSet(..), SealedPatchSet)
src/Darcs/Commands/Pull.hs:233:36: Error: Use notElem
Found
Found
not (XMLOutput `elem` opts)Why not
notElem XMLOutput opts
src/Darcs/Commands/Pull.hs:251:39: Warning: Redundant $
Found
Found
text "We have the following new (to them) patches:" $$ (vcat $ mapFL description x)Why not
text "We have the following new (to them) patches:" $$ vcat (mapFL description x)
src/Darcs/Commands/Pull.hs:254:11: Error: Use unless
Found
Found
when (not $ nullFL ps)Why not
unless (nullFL ps)
src/Darcs/Commands/Pull.hs:254:47: Warning: Redundant $
Found
Found
text "They have the following patches to pull:" $$ (vcat $ mapFL description ps)Why not
text "They have the following patches to pull:" $$ vcat (mapFL description ps)
src/Darcs/Commands/Pull.hs:265:26: Warning: Redundant $
Found
Found
runSelection (selector psFiltered) $ contextWhy not
runSelection (selector psFiltered) context
src/Darcs/Commands/Pull.hs:290:16: Error: Use unless
Found
Found
when (not $ isInteractive opts)Why not
unless (isInteractive opts)
src/Darcs/Commands/Pull.hs:291:16: Warning: Redundant $
Found
Found
putStrLn $ "Looks like those patches do not pass the tests."Why not
putStrLn "Looks like those patches do not pass the tests."
src/Darcs/Commands/Pull.hs:316:7: Warning: Redundant $
Found
Found
useAbsoluteOrStd writeDocBinFile putDoc o $ bundleWhy not
useAbsoluteOrStd writeDocBinFile putDoc o bundle
src/Darcs/Commands/Convert.hs:166:50: Error: Use notElem
Found
Found
not (info t `elem` inOrderTags)Why not
notElem (info t) inOrderTags
src/Darcs/Commands/Convert.hs:208:7: Warning: Redundant $
Found
Found
when (SetScriptsExecutable `elem` opts) $ setScriptsExecutableWhy not
when (SetScriptsExecutable `elem` opts) setScriptsExecutable
src/Darcs/Commands/ShowAuthors.hs:136:14: Warning: Redundant bracket
Found
Found
(Spelling name email _) : _Why not
Spelling name email _ : _
src/Darcs/Commands/ShowAuthors.hs:155:14: Warning: Redundant bracket
Found
Found
(Left err) : xsWhy not
Left err : xs
src/Darcs/Commands/ShowAuthors.hs:160:14: Warning: Redundant bracket
Found
Found
(Right Nothing) : xsWhy not
Right Nothing : xs
src/Darcs/Commands/ShowAuthors.hs:162:13: Warning: Redundant bracket
Found
Found
((Right (Just a) : xs))Why not
(Right (Just a) : xs)
src/Darcs/Commands/Apply.hs:250:9: Error: Use unless
Found
Found
when (not $ isInteractive opts)Why not
unless (isInteractive opts)
src/Darcs/Commands/Apply.hs:251:9: Warning: Redundant $
Found
Found
putStrLn $ "Looks like those patches do not pass the tests."Why not
putStrLn "Looks like those patches do not pass the tests."
src/Darcs/Commands/Apply.hs:332:31: Warning: Redundant bracket
Found
Found
(do a <- doit hClose stdout hClose stderr return a) `catch` (sendit tempf)Why not
(do a <- doit hClose stdout hClose stderr return a) `catch` sendit tempf
src/Darcs/Commands/Apply.hs:341:15: Warning: Use view patterns
Found
Found
sendit tempf e | Just (_ :: ExitCode) <- fromException e = do sendSanitizedEmail opts f to "Patch failed!" cc tempf throwIO ExitSuccessWhy not
sendit tempf (fromException -> Just (_ :: ExitCode)) = do sendSanitizedEmail opts f to "Patch failed!" cc tempf throwIO ExitSuccess
src/Darcs/Commands/Apply.hs:389:26: Error: Use elem
Found
Found
t == f' || t == init f'Why not
t `elem` [f', init f']
src/Darcs/Commands/Util.hs:49:34: Error: Use .
Found
Found
mapM exists $ map floatPath pathsWhy not
mapM (exists . floatPath) paths
src/Darcs/Commands/Help.hs:69:36: Warning: Redundant $
Found
Found
text $ helpOnMatchersWhy not
text helpOnMatchers
src/Darcs/Commands/Help.hs:103:54: Warning: Redundant bracket
Found
Found
(commandPrereq c) []Why not
commandPrereq c []
src/Darcs/Commands/Help.hs:240:21: Warning: Redundant $
Found
Found
(map mangle_args $ commandExtraArgHelp c) ++ [".br"]Why not
map mangle_args (commandExtraArgHelp c) ++ [".br"]
src/Darcs/Commands/Help.hs:262:21: Warning: Redundant $
Found
Found
(map mangle_args $ commandExtraArgHelp c) ++ [".RS 4", escape $ commandHelp c, ".RE"]Why not
map mangle_args (commandExtraArgHelp c) ++ [".RS 4", escape $ commandHelp c, ".RE"]
src/Darcs/Commands/Help.hs:270:11: Warning: Redundant $
Found
Found
".RI " ++ (unwords $ map show (groupBy cmp $ map toLower $ gank s))Why not
".RI " ++ unwords (map show (groupBy cmp $ map toLower $ gank s))
src/Darcs/Commands/Help.hs:293:24: Warning: Redundant bracket
Found
Found
repl ++ (replace find repl (drop (length find) s))Why not
repl ++ replace find repl (drop (length find) s)
src/Darcs/Commands/Help.hs:294:24: Warning: Use :
Found
Found
[head s] ++ replace find repl (tail s)Why not
(head s) : replace find repl (tail s)
src/Darcs/Commands/Put.hs:62:46: Warning: Use :
Found
Found
[applyas] ++ networkOptionsWhy not
applyas : networkOptions
src/Darcs/Commands/Put.hs:88:59: Warning: Redundant bracket
Found
Found
(commandCommand initialize) initoptsWhy not
commandCommand initialize initopts
src/Darcs/Commands/Put.hs:89:11: Error: Redundant do
Found
Found
do remoteInit (splitSshUrl req_absolute_repo_dir) initoptsWhy not
remoteInit (splitSshUrl req_absolute_repo_dir) initopts
src/Darcs/Commands/Put.hs:97:21: Warning: Use fmap
Found
Found
readRepo repository >>= (return . seal)Why not
fmap seal (readRepo repository)
src/Darcs/Commands/Put.hs:112:37: Warning: Redundant $
Found
Found
putStrLn $ "Apply failed!"Why not
putStrLn "Apply failed!"
src/Darcs/Commands/Put.hs:120:53: Warning: Redundant bracket
Found
Found
(sshRepo repo) ++ "' " ++ unwords argsWhy not
sshRepo repo ++ "' " ++ unwords args
src/Darcs/Commands/Unrevert.hs:111:40: Error: Redundant do
Found
Found
do case commute (pend :> ps) of Nothing -> do really <- askUser "You will not be able to unrevert this operation! Proceed? " case really of ('y' : _) -> return () _ -> exitWith $ ExitSuccess writeUnrevert repository NilFL rec pend Just (p' :> _) -> do rep <- readRepo repository date <- getIsoDateTime np <- namepatch date "unrevert" "anon" [] (fromRepoPrims repository p') bundle <- makeBundleN (Just rec) rep (np :>: NilFL) writeDocBinFile (unrevertUrl repository) bundle where fromRepoPrims :: (RepoPatch p) => Repository p wR wU wT -> FL (PrimOf p) wR wY -> FL p wR wY fromRepoPrims _ xs = fromPrims xsWhy not
case commute (pend :> ps) of Nothing -> do really <- askUser "You will not be able to unrevert this operation! Proceed? " case really of ('y' : _) -> return () _ -> exitWith $ ExitSuccess writeUnrevert repository NilFL rec pend Just (p' :> _) -> do rep <- readRepo repository date <- getIsoDateTime np <- namepatch date "unrevert" "anon" [] (fromRepoPrims repository p') bundle <- makeBundleN (Just rec) rep (np :>: NilFL) writeDocBinFile (unrevertUrl repository) bundle where fromRepoPrims :: (RepoPatch p) => Repository p wR wU wT -> FL (PrimOf p) wR wY -> FL p wR wY fromRepoPrims _ xs = fromPrims xs
src/Darcs/Commands/Unrevert.hs:115:39: Warning: Redundant $
Found
Found
exitWith $ ExitSuccessWhy not
exitWith ExitSuccess
src/Darcs/Commands/Unrevert.hs:124:15: Error: Eta reduce
Found
Found
fromRepoPrims _ xs = fromPrims xsWhy not
fromRepoPrims _ = fromPrims
src/Darcs/Witnesses/Sealed.hs:44:16: Warning: Parse error
Error message
Error message
Parse error: !Code
data Sealed2 a where > Sealed2 :: !(a wX wY) -> Sealed2 a seal2 :: a wX wY -> Sealed2 a
src/Darcs/Witnesses/WZipper.hs:38:1: Error: Eta reduce
Found
Found
flToZipper l = FZipper NilRL lWhy not
flToZipper = FZipper NilRL
src/Darcs/Witnesses/WZipper.hs:81:40: Warning: Redundant bracket
Found
Found
(reverseRL l) +>+ rWhy not
reverseRL l +>+ r
src/Darcs/Witnesses/Ordered.hs:45:1: Warning: Parse error
Error message
Error message
Illegal data/newtype declarationCode
data (a1 :> a2) wX wY = forall wZ . (a1 wX wZ) :> (a2 wZ wY) > infixr 1 :> data (a1 :< a2) wX wY = forall wZ . (a1 wZ wY) :< (a2 wX wZ) infix 1 :<
src/Darcs/Patch/ReadMonads.hs:1:1: Error: Unused LANGUAGE pragma
Found
Found
{-# LANGUAGE BangPatterns #-}
Why not remove it.
src/Darcs/Patch/ReadMonads.hs:134:52: Warning: Redundant bracket
Found
Found
(reverse acc :*: s)Why not
reverse acc :*: s
src/Darcs/Patch/ReadMonads.hs:136:22: Warning: Redundant bracket
Found
Found
case breakFirstPS '\n' s' of Just (l, r) -> lsw (l : acc) r Nothing -> (reverse (s' : acc) :*: B.empty)Why not
case breakFirstPS '\n' s' of Just (l, r) -> lsw (l : acc) r Nothing -> reverse (s' : acc) :*: B.empty
src/Darcs/Patch/ReadMonads.hs:153:3: Warning: Use guards
Found
Found
lswew x = if BC.head x == en then Just ([] :*: B.tail x) else if BC.head x /= st then Nothing else case BC.break ((==) '\n') $ B.tail x of (l, r) -> case lswew $ B.tail r of Just (ls :*: r') -> Just ((l : ls) :*: r') Nothing -> case breakLastPS en l of Just (l2, _) -> Just ([l2] :*: B.drop (B.length l2 + 2) x) Nothing -> NothingWhy not
lswew x | BC.head x == en = Just ([] :*: B.tail x) | BC.head x /= st = Nothing | otherwise = case BC.break ((==) '\n') $ B.tail x of (l, r) -> case lswew $ B.tail r of Just (ls :*: r') -> Just ((l : ls) :*: r') Nothing -> case breakLastPS en l of Just (l2, _) -> Just ([l2] :*: B.drop (B.length l2 + 2) x) Nothing -> Nothing
src/Darcs/Patch/ReadMonads.hs:158:29: Warning: Use section
Found
Found
((==) '\n')Why not
('\n' ==)
src/Darcs/Patch/ReadMonads.hs:245:5: Error: Eta reduce
Found
Found
work f = SM fWhy not
work = SM
src/Darcs/Patch/FileName.hs:45:1: Error: Eta reduce
Found
Found
fp2fn fp = FN fpWhy not
fp2fn = FN
src/Darcs/Patch/FileName.hs:76:12: Warning: Redundant $
Found
Found
(show $ ord c) ++ "\\" ++ encodeWhite csWhy not
show (ord c) ++ "\\" ++ encodeWhite cs
src/Darcs/Patch/FileName.hs:119:23: Warning: Redundant bracket
Found
Found
".." : (dropDotdot p)Why not
".." : dropDotdot p
src/Darcs/Patch/RegChars.hs:22:25: Warning: Redundant bracket
Found
Found
(a -> Bool) -> (a -> Bool)Why not
(a -> Bool) -> a -> Bool
src/Darcs/Patch/RegChars.hs:25:25: Warning: Redundant bracket
Found
Found
(a -> Bool) -> (a -> Bool)Why not
(a -> Bool) -> a -> Bool
src/Darcs/Patch/RegChars.hs:41:13: Warning: Redundant bracket
Found
Found
String -> (Char -> Bool)Why not
String -> Char -> Bool
src/Darcs/Patch/RegChars.hs:66:19: Warning: Redundant bracket
Found
Found
String -> (Char -> Bool)Why not
String -> Char -> Bool
src/Darcs/Patch/Bracketed.hs:37:1: Error: Eta reduce
Found
Found
mapBracketedFL_FL f ps = mapFL_FL (mapBracketed f) psWhy not
mapBracketedFL_FL f = mapFL_FL (mapBracketed f)
src/Darcs/Patch/Bracketed.hs:37:1: Warning: Use camelCase
Found
Found
mapBracketedFL_FL f ps = ...Why not
mapBracketedFLFL f ps = ...
src/Darcs/Patch/Named.hs:58:15: Warning: Parse error
Error message
Error message
Parse error: !Code
-- | The @Named@ type adds a patch info about a patch, that is a name. data Named p wX wY where > NamedP :: !PatchInfo -> ![PatchInfo] -> !(FL p wX wY)
src/Darcs/Patch/PatchInfoAnd.hs:122:1: Warning: Use camelCase
Found
Found
fmapFL_PIAP f (PIAP i hp) = ...Why not
fmapFLPIAP f (PIAP i hp) = ...
src/Darcs/Patch/PatchInfoAnd.hs:159:20: Error: Redundant do
Found
Found
do mapSeal (Hashed h) `fmap` unsafeInterleaveIO (f' `catchNonSignal` handler)Why not
mapSeal (Hashed h) `fmap` unsafeInterleaveIO (f' `catchNonSignal` handler)
src/Darcs/Patch/Choices.hs:106:10: Warning: Parse error
Error message
Error message
Parse error: {
Codedata PatchChoices p wX wY where > PCs :: { pcsFirsts :: FL (TaggedPatch p) wX wM , pcsLasts :: FL (PatchChoice p) wM wY} -> PatchChoices p wX wY
src/Darcs/Patch/Info.hs:59:1: Error: Eta reduce
Found
Found
repopatchinfo r pi = RPI r piWhy not
repopatchinfo = RPI
src/Darcs/Patch/Info.hs:86:5: Warning: Redundant $
Found
Found
addJunk $ PatchInfo{_piDate = BC.pack date, _piName = packStringToUTF8 name, _piAuthor = packStringToUTF8 author, _piLog = map packStringToUTF8 log, isInverted = False}Why not
addJunk PatchInfo{_piDate = BC.pack date, _piName = packStringToUTF8 name, _piAuthor = packStringToUTF8 author, _piLog = map packStringToUTF8 log, isInverted = False}
src/Darcs/Patch/Info.hs:196:23: Error: Use notElem
Found
Found
not ('\65533' `elem` bsUtf8)Why not
notElem '\65533' bsUtf8
src/Darcs/Patch/Info.hs:245:17: Warning: Redundant bracket
Found
Found
y ++ (strReplace x y zs)Why not
y ++ strReplace x y zs
src/Darcs/Patch/Info.hs:246:17: Warning: Redundant bracket
Found
Found
z : (strReplace x y zs)Why not
z : strReplace x y zs
src/Darcs/Patch/Info.hs:292:19: Warning: Redundant bracket
Found
Found
(take 40 s) ++ "..." ++ (reverse $ take 30 $ reverse s)Why not
take 40 s ++ "..." ++ (reverse $ take 30 $ reverse s)
src/Darcs/Patch/Info.hs:292:32: Warning: Redundant $
Found
Found
"..." ++ (reverse $ take 30 $ reverse s)Why not
"..." ++ reverse (take 30 $ reverse s)
src/Darcs/Patch/Info.hs:349:21: Warning: Use foldr
Found
Found
mul [] = text "\n" mul (s : ss) = text "\n " <> packedString s <> mul ssWhy not
mul ss = foldr (\ s -> (<>) (text "\n " <> packedString s)) (text "\n") ss
src/Darcs/Patch/Info.hs:362:33: Error: Redundant bracket
Found
Found
(PatchInfo)Why not
PatchInfo
src/Darcs/Patch/Info.hs:370:23: Error: Use elem
Found
Found
c == ']' || c == '\n'Why not
c `elem` [']', '\n']
src/Darcs/Patch/Info.hs:373:3: Warning: Redundant $
Found
Found
return $ PatchInfo{_piDate = ct, _piName = name, _piAuthor = author, _piLog = log, isInverted = BC.index s2 1 /= '*'}Why not
return PatchInfo{_piDate = ct, _piName = name, _piAuthor = author, _piLog = log, isInverted = BC.index s2 1 /= '*'}
src/Darcs/Patch/Info.hs:390:18: Warning: Redundant $
Found
Found
td << (friendlyD $ _piDate pi)Why not
td << friendlyD (_piDate pi)
src/Darcs/Patch/TouchesFiles.hs:54:11: Warning: Reduce duplication
Found
Found
ct :: (Patchy p, ApplyState p ~ Tree) => [FilePath] -> FL (TaggedPatch p) wX wY -> [Tag] ct _ NilFL = [] ct fs (tp :>: tps) = case lookTouchOnlyEffect fs (tpPatch tp) of (True, fs') -> ct fs' tps (False, fs') -> tag tp : ct fs' tps xs = case getChoices pc of (fc :> mc) :> _ -> ct (map fix files) (fc +>+ mc)Why not
Combine with src/Darcs/Patch/TouchesFiles.hs:66:11
src/Darcs/Patch/ConflictMarking.hs:33:15: Warning: Redundant bracket
Found
Found
(Sealed ((is_filepatch -> Just f) :>: _)) : _Why not
Sealed ((is_filepatch -> Just f) :>: _) : _
src/Darcs/Patch/ConflictMarking.hs:37:1: Warning: Use foldl
Found
Found
getOld mls (ps : pss) = getOld (getHunksOld mls ps) pss getOld mls [] = mlsWhy not
getOld mls pss = foldl getHunksOld mls pss
src/Darcs/Patch/ConflictMarking.hs:90:46: Warning: Use intercalate
Found
Found
concat (intersperse [middle] nchs)Why not
intercalate [middle] nchs
src/Darcs/Patch/MatchData.hs:28:1: Error: Eta reduce
Found
Found
patchMatch s = PatternMatch sWhy not
patchMatch = PatternMatch
src/Darcs/Patch/Permutations.hs:52:16: Warning: Redundant bracket
Found
Found
FL p wX wY -> ((FL p :> FL p :> FL p) wX wY)Why not
FL p wX wY -> (FL p :> FL p :> FL p) wX wY
src/Darcs/Patch/Permutations.hs:60:17: Warning: Redundant bracket
Found
Found
FL p wC wD -> ((FL p :> FL p :> FL p) wA wD)Why not
FL p wC wD -> (FL p :> FL p :> FL p) wA wD
src/Darcs/Patch/Permutations.hs:63:1: Error: Eta reduce
Found
Found
partitionFL keepleft ps = partitionFL' keepleft NilRL NilRL psWhy not
partitionFL keepleft = partitionFL' keepleft NilRL NilRL
src/Darcs/Patch/Permutations.hs:65:37: Warning: Redundant bracket
Found
Found
(NilFL :> reverseRL middle :> reverseRL right)Why not
NilFL :> reverseRL middle :> reverseRL right
src/Darcs/Patch/Permutations.hs:69:33: Warning: Redundant bracket
Found
Found
case partitionFL' keepleft middle' right' ps of ((a :> b) :> c) -> (p'' :>: a :> b :> c)Why not
case partitionFL' keepleft middle' right' ps of ((a :> b) :> c) -> p'' :>: a :> b :> c
src/Darcs/Patch/Permutations.hs:278:36: Warning: Redundant bracket
Found
Found
(NilFL :> NilFL)Why not
NilFL :> NilFL
src/Darcs/Patch/Depends.hs:229:25: Warning: Redundant bracket
Found
Found
extraDeps ++ (delete (fst hp) ds)Why not
extraDeps ++ delete (fst hp) ds
src/Darcs/Patch/Match.hs:95:25: Warning: Reduce duplication
Found
Found
_ <- trystring name spaces return funWhy not
Combine with src/Darcs/Patch/Match.hs:98:42
src/Darcs/Patch/Match.hs:56:1: Error: Eta reduce
Found
Found
makeMatcher s m = MATCH s mWhy not
makeMatcher = MATCH
src/Darcs/Patch/Match.hs:102:30: Warning: Redundant bracket
Found
Found
(m1 p) || (m2 p)Why not
m1 p || (m2 p)
src/Darcs/Patch/Match.hs:102:30: Warning: Redundant bracket
Found
Found
(m1 p) || (m2 p)Why not
(m1 p) || m2 p
src/Darcs/Patch/Match.hs:103:31: Warning: Redundant bracket
Found
Found
(m1 p) && (m2 p)Why not
m1 p && (m2 p)
src/Darcs/Patch/Match.hs:103:31: Warning: Redundant bracket
Found
Found
(m1 p) && (m2 p)Why not
(m1 p) && m2 p
src/Darcs/Patch/Match.hs:194:1: Error: Eta reduce
Found
Found
parens p = between (string "(") (string ")") pWhy not
parens = between (string "(") (string ")")
src/Darcs/Patch/Match.hs:199:42: Warning: Use string literal
Found
Found
['\\', '"']Why not
"\\\""
src/Darcs/Patch/Match.hs:201:38: Warning: Use string literal
Found
Found
['"']Why not
"\""
src/Darcs/Patch/Match.hs:209:29: Warning: Redundant bracket
Found
Found
r == (justName (info hp))Why not
r == justName (info hp)
src/Darcs/Patch/Match.hs:217:47: Warning: Redundant bracket
Found
Found
isJust . (matchRegex (mkRegex r) . BC.unpack)Why not
isJust . matchRegex (mkRegex r) . BC.unpack
src/Darcs/Patch/Match.hs:221:35: Error: Use elem
Found
Found
(rh == h) || (rh == h ++ ".gz")Why not
(rh `elem` [h, h ++ ".gz"])
src/Darcs/Patch/Match.hs:227:32: Error: Use any
Found
Found
or $ map (isJust . matchRegex (mkRegex r)) filesWhy not
(any (isJust . matchRegex (mkRegex r)) files)
src/Darcs/Patch/ApplyMonad.hs:135:18: Warning: Redundant bracket
Found
Found
(Maybe [OrigFileNameOf]) -> [FileName] -> FilePathMonad a -> FilePathMonadStateWhy not
Maybe [OrigFileNameOf] -> [FileName] -> FilePathMonad a -> FilePathMonadState
src/Darcs/Patch/ApplyMonad.hs:138:13: Error: Use fromMaybe
Found
Found
maybe (map (\ y -> (y, y)) fps) idWhy not
Data.Maybe.fromMaybe (map (\ y -> (y, y)) fps)
src/Darcs/Patch/OldDate.hs:119:20: Error: Reduce duplication
Found
Found
d <- day _ <- mySpaces h <- hour _ <- char ':' m <- minute _ <- char ':' s <- secondWhy not
Combine with src/Darcs/Patch/OldDate.hs:134:23
src/Darcs/Patch/OldDate.hs:101:20: Warning: Use .
Found
Found
foldr (<|>) (return []) (map (\ x -> try $ count x p) (reverse [1 .. m]))Why not
foldr ((<|>) . (\ x -> try $ count x p)) (return []) (reverse [1 .. m])
src/Darcs/Patch/OldDate.hs:197:41: Warning: Redundant bracket
Found
Found
(7 * w) + wd - (fromEnum firstDay)Why not
(7 * w) + wd - fromEnum firstDay
src/Darcs/Patch/OldDate.hs:198:23: Warning: Redundant bracket
Found
Found
[(toUTCTime . toClockTime . diff . yfn)]Why not
[toUTCTime . toClockTime . diff . yfn]
src/Darcs/Patch/OldDate.hs:234:39: Warning: Redundant bracket
Found
Found
10 ^ (picoExp - digsExp) * (read digs)Why not
10 ^ (picoExp - digsExp) * read digs
src/Darcs/Patch/OldDate.hs:237:34: Error: Redundant do
Found
Found
do char '+' >> return 1Why not
char '+' >> return 1
src/Darcs/Patch/OldDate.hs:238:34: Error: Redundant do
Found
Found
do char '-' >> return (-1)Why not
char '-' >> return (-1)
src/Darcs/Patch/OldDate.hs:278:24: Warning: Redundant $
Found
Found
intToMonth $ (read mn :: Int)Why not
intToMonth (read mn :: Int)
src/Darcs/Patch/OldDate.hs:342:78: Warning: Use string literal
Found
Found
[' ']Why not
" "
src/Darcs/Patch/Conflict.hs:67:12: Warning: Parse error
Error message
Error message
Parse error: !Code
data IsConflictedPrim prim where > IsC :: !ConflictState -> !(prim wX wY) -> IsConflictedPrim prim data ConflictState = Okay | Conflicted | Duplicated deriving ( Eq, Ord, Show, Read)
src/Darcs/Patch/Summary.hs:41:17: Warning: Redundant bracket
Found
Found
y ++ (strReplace x y zs)Why not
y ++ strReplace x y zs
src/Darcs/Patch/Summary.hs:42:17: Warning: Redundant bracket
Found
Found
z : (strReplace x y zs)Why not
z : strReplace x y zs
src/Darcs/Patch/Summary.hs:53:31: Warning: Avoid lambda
Found
Found
\ d -> SummChunk d cWhy not
(`SummChunk` c)
src/Darcs/Patch/V1/Read.hs:25:15: Warning: Redundant $
Found
Found
liftM (mapSeal PP) $ readPatch'Why not
liftM (mapSeal PP) readPatch'
src/Darcs/Patch/V1/Commute.hs:52:1: Error: Use fewer imports
Found
Found
import Darcs.Witnesses.Sealed (unsafeUnseal, unsafeUnsealFlipped) import Darcs.Witnesses.Sealed (Sealed(..), mapSeal, unseal, FlippedSeal(..), mapFlipped)Why not
import Darcs.Witnesses.Sealed (unsafeUnseal, unsafeUnsealFlipped, Sealed(..), mapSeal, unseal, FlippedSeal(..), mapFlipped)
src/Darcs/Patch/V1/Commute.hs:344:19: Warning: Redundant $
Found
Found
(map Sealed $ nubBy unsafeCompare $ effect (unsafeCoercePStart $ unsafeUnseal (glump09 p1 p2)) : map (unsafeCoercePStart . unsafeUnseal) (unravel p')) : rcs (p :>: passedby) psWhy not
map Sealed (nubBy unsafeCompare $ effect (unsafeCoercePStart $ unsafeUnseal (glump09 p1 p2)) : map (unsafeCoercePStart . unsafeUnseal) (unravel p')) : rcs (p :>: passedby) ps
src/Darcs/Patch/V1/Commute.hs:366:15: Error: Use any
Found
Found
or $ map (`isSuperpatchOf` x) xs'Why not
any (`isSuperpatchOf` x) xs'
src/Darcs/Patch/V1/Commute.hs:391:32: Warning: Redundant $
Found
Found
unsafeCoerceP $ NilFLWhy not
unsafeCoerceP NilFL
src/Darcs/Patch/V1/Viewing.hs:2:1: Error: Unused LANGUAGE pragma
Found
Found
{-# LANGUAGE ViewPatterns #-}
Why not remove it.
src/Darcs/Patch/V1/Apply.hs:4:1: Error: Use fewer imports
Found
Found
import Darcs.Patch.Apply (Apply, apply) import Darcs.Patch.Apply (ApplyState)Why not
import Darcs.Patch.Apply (Apply, apply, ApplyState)
src/Darcs/Patch/V2/Real.hs:231:28: Warning: Reduce duplication
Found
Found
(b', xs') <- mac b xs goneby let pa = joinEffects $ p' :<: a NilFL <- return pa return (reverseRL (p' :<: a) +>+ b', xs')Why not
Combine with src/Darcs/Patch/V2/Real.hs:245:36
src/Darcs/Patch/V2/Non.hs:211:30: Warning: Redundant $
Found
Found
map commuteOrAddInvC $ nsWithoutCWhy not
map commuteOrAddInvC nsWithoutC
src/Darcs/Patch/Prim/V1/Read.hs:41:10: Warning: Redundant $
Found
Found
return' $ readChangePrefWhy not
return' readChangePref
src/Darcs/Patch/Prim/V1/Show.hs:142:27: Warning: Redundant $
Found
Found
formatFileName x f $$ invisibleText "oldhex" $$ (vcat $ map makeprintable $ breakEvery 78 $ fromPS2Hex o) $$ invisibleText "newhex" $$ (vcat $ map makeprintable $ breakEvery 78 $ fromPS2Hex n)Why not
formatFileName x f $$ invisibleText "oldhex" $$ (vcat $ map makeprintable $ breakEvery 78 $ fromPS2Hex o) $$ invisibleText "newhex" $$ vcat (map makeprintable $ breakEvery 78 $ fromPS2Hex n)
src/Darcs/Patch/Prim/V1/Show.hs:142:27: Warning: Redundant $
Found
Found
formatFileName x f $$ invisibleText "oldhex" $$ (vcat $ map makeprintable $ breakEvery 78 $ fromPS2Hex o)Why not
formatFileName x f $$ invisibleText "oldhex" $$ vcat (map makeprintable $ breakEvery 78 $ fromPS2Hex o)
src/Darcs/Patch/Prim/V1/Commute.hs:116:6: Warning: Redundant $
Found
Found
(not $ isInDirectory d1 d2) && (not $ isInDirectory d2 d1) && d1 /= d2Why not
not (isInDirectory d1 d2) && (not $ isInDirectory d2 d1) && d1 /= d2
src/Darcs/Patch/Prim/V1/Commute.hs:116:37: Warning: Redundant $
Found
Found
(not $ isInDirectory d2 d1) && d1 /= d2Why not
not (isInDirectory d2 d1) && d1 /= d2
src/Darcs/Patch/Prim/V1/Commute.hs:127:8: Error: Use elem
Found
Found
p2 == AddFile || p2 == RmFileWhy not
p2 `elem` [AddFile, RmFile]
src/Darcs/Patch/Prim/V1/Commute.hs:213:1: Error: Eta reduce
Found
Found
tryTokReplace t o n mss = mapM (fmap B.concat . tryTokInternal t (BC.pack o) (BC.pack n)) mssWhy not
tryTokReplace t o n = mapM (fmap B.concat . tryTokInternal t (BC.pack o) (BC.pack n))
src/Darcs/Patch/Prim/V1/Core.hs:43:13: Warning: Parse error
Error message
Error message
Parse error: !Code
data Prim wX wY where > Move :: !FileName -> !FileName -> Prim wX wY DP :: !FileName -> !(DirPatchType wX wY) -> Prim wX wY FP :: !FileName -> !(FilePatchType wX wY) -> Prim wX wY
src/Darcs/Patch/Prim/V1/Apply.hs:59:21: Warning: Use if
Found
Found
case B.null x of True -> Nothing False -> Just ("WARNING: Fixing removal of non-empty file " ++ fn2fp f, FP f (Binary x B.empty) :>: FP f RmFile :>: NilFL)Why not
(if B.null x then Nothing else Just ("WARNING: Fixing removal of non-empty file " ++ fn2fp f, FP f (Binary x B.empty) :>: FP f RmFile :>: NilFL))
src/Darcs/Patch/Prim/V1/Apply.hs:89:18: Warning: Redundant bracket
Found
Found
(FP f h@(Hunk _ _ _)) :>: the_psWhy not
FP f h@(Hunk _ _ _) :>: the_ps
src/Darcs/Patch/Prim/V1/Apply.hs:104:40: Warning: Redundant $
Found
Found
(renderString $ showHunk NewFormat f line old new) ++ "\n### to file " ++ fn2fp f ++ ":\n" ++ BC.unpack psWhy not
renderString (showHunk NewFormat f line old new) ++ "\n### to file " ++ fn2fp f ++ ":\n" ++ BC.unpack ps
src/Darcs/Patch/Prim/V1/Apply.hs:140:25: Warning: Redundant $
Found
Found
fail $ "applyHunkLines: Bad patch!"Why not
fail "applyHunkLines: Bad patch!"
src/Darcs/Patch/Prim/V1/Coalesce.hs:65:9: Warning: Use foldr
Found
Found
unsealList [] = unsafeCoerceP NilFL unsealList (y : ys) = unsafeUnseal2 y :>: unsealList ysWhy not
unsealList ys = foldr ((:>:) . unsafeUnseal2) (unsafeCoerceP NilFL) ys
src/Darcs/Patch/Prim/V1/Coalesce.hs:69:44: Warning: Use second
Found
Found
\ (fn, s) -> (fn, Sealed2 s)Why not
Control.Arrow.second Sealed2
src/Darcs/Patch/Prim/V1/Coalesce.hs:90:1: Error: Eta reduce
Found
Found
fromSimples a bs = mapFL_FL (fromSimple a) bsWhy not
fromSimples a = mapFL_FL (fromSimple a)
src/Darcs/Patch/Prim/V1/Coalesce.hs:93:38: Error: Use fromMaybe
Found
Found
maybe x idWhy not
Data.Maybe.fromMaybe x
src/Darcs/Patch/Prim/V1/Coalesce.hs:107:5: Warning: Use fromMaybe
Found
Found
case tryOne NilRL p ps of Nothing -> p :>: shrinkABit ps Just ps' -> ps'Why not
fromMaybe (p :>: shrinkABit ps) (tryOne NilRL p ps)
src/Darcs/Patch/Prim/V1/Coalesce.hs:215:5: Warning: Use .
Found
Found
foldr (joinGap (:>:)) (emptyGap NilFL) $ map (\ (l, o, n) -> freeGap (FP f (Hunk (l + line) o n))) changesWhy not
foldr (joinGap (:>:) . (\ (l, o, n) -> freeGap (FP f (Hunk (l + line) o n)))) (emptyGap NilFL) changes
src/Darcs/Patch/Prim/V1/Coalesce.hs:225:41: Warning: Use fromMaybe
Found
Found
case tryShrinkingInverse (x :>: yz') of Nothing -> x :>: yz' Just xyz' -> xyz'Why not
fromMaybe (x :>: yz') (tryShrinkingInverse (x :>: yz'))
src/Darcs/Patch/Prim/V1/Coalesce.hs:231:4: Warning: Use view patterns
Found
Found
canonize p | IsEq <- isIdentity p = NilFLWhy not
canonize (isIdentity -> IsEq) = NilFL
src/Darcs/Patch/Prim/V3/Show.hs:2:1: Error: Unused LANGUAGE pragma
Found
Found
{-# LANGUAGE CPP, ViewPatterns, OverloadedStrings #-}
Why not{-# LANGUAGE CPP, OverloadedStrings #-}
src/Darcs/Patch/Prim/V3/Commute.hs:44:21: Warning: Redundant bracket
Found
Found
(BinaryHunk a x) :> (BinaryHunk _ y)Why not
BinaryHunk a x :> (BinaryHunk _ y)
src/Darcs/Patch/Prim/V3/Commute.hs:44:21: Warning: Redundant bracket
Found
Found
(BinaryHunk a x) :> (BinaryHunk _ y)Why not
(BinaryHunk a x) :> BinaryHunk _ y
src/Darcs/Patch/Prim/V3/Commute.hs:47:21: Warning: Redundant bracket
Found
Found
(TextHunk a x) :> (TextHunk _ y)Why not
TextHunk a x :> (TextHunk _ y)
src/Darcs/Patch/Prim/V3/Commute.hs:47:21: Warning: Redundant bracket
Found
Found
(TextHunk a x) :> (TextHunk _ y)Why not
(TextHunk a x) :> TextHunk _ y
src/Darcs/Patch/Prim/V3/Commute.hs:53:14: Warning: Redundant bracket
Found
Found
(Hunk off1 old1 new1) :> (Hunk off2 old2 new2)Why not
Hunk off1 old1 new1 :> (Hunk off2 old2 new2)
src/Darcs/Patch/Prim/V3/Commute.hs:53:14: Warning: Redundant bracket
Found
Found
(Hunk off1 old1 new1) :> (Hunk off2 old2 new2)Why not
(Hunk off1 old1 new1) :> Hunk off2 old2 new2
src/Darcs/Patch/Prim/V3/Commute.hs:57:14: Warning: Redundant bracket
Found
Found
(Hunk off2 old2 new2) :> Hunk (off1 + lengthnew2 - lengthold2) old1 new1Why not
Hunk off2 old2 new2 :> Hunk (off1 + lengthnew2 - lengthold2) old1 new1
src/Darcs/Patch/Prim/V3/Core.hs:42:11: Warning: Parse error
Error message
Error message
Parse error: !Code
data Hunk wX wY where > Hunk :: !Int -> BS.ByteString -> BS.ByteString -> Hunk wX wY invertHunk :: Hunk wX wY -> Hunk wY wX
src/Darcs/Repository/Old.hs:64:34: Warning: Use section
Found
Found
((==) '\n')Why not
('\n' ==)
src/Darcs/Repository/Old.hs:84:47: Warning: Use section
Found
Found
((==) '\n')Why not
('\n' ==)
src/Darcs/Repository/Format.hs:39:1: Warning: Use camelCase
Found
Found
data RepoProperty = Darcs1_0 | Darcs2 | HashedInventory | NoWorkingDir | UnknownFormat String deriving EqWhy not
data RepoProperty = Darcs10 | Darcs2 | HashedInventory | NoWorkingDir | UnknownFormat String deriving Eq
src/Darcs/Repository/Prefs.hs:197:16: Warning: Redundant bracket
Found
Found
fmap Just (getAppUserDataDirectory "darcs") `catchall` (return Nothing)Why not
fmap Just (getAppUserDataDirectory "darcs") `catchall` return Nothing
src/Darcs/Repository/Prefs.hs:234:5: Error: Redundant lambda
Found
Found
handleBadRegex = \ _ -> hPutDocLn stderr warning >> return NothingWhy not
handleBadRegex _ = hPutDocLn stderr warning >> return Nothing
src/Darcs/Repository/Cache.hs:20:1: Error: Use fewer imports
Found
Found
import System.Directory (removeFile, doesFileExist, doesDirectoryExist, getDirectoryContents, getPermissions) import qualified System.Directory as SD (writable) import System.Directory (createDirectoryIfMissing)Why not
import qualified System.Directory as SD (writable) import System.Directory (removeFile, doesFileExist, doesDirectoryExist, getDirectoryContents, getPermissions, createDirectoryIfMissing)
src/Darcs/Repository/Cache.hs:23:1: Error: Use fewer imports
Found
Found
import System.Posix.Files (linkCount, getSymbolicLinkStatus) import System.Posix.Files (createLink)Why not
import System.Posix.Files (linkCount, getSymbolicLinkStatus, createLink)
src/Darcs/Repository/Cache.hs:96:53: Error: Redundant bracket
Found
Found
(Cache)Why not
Cache
src/Darcs/Repository/Cache.hs:101:20: Warning: Use fmap
Found
Found
mapM (\ x -> fn x `catchall` return Nothing) remote >>= return . catMaybesWhy not
fmap catMaybes (mapM (\ x -> fn x `catchall` return Nothing) remote)
src/Darcs/Repository/Cache.hs:139:32: Error: Use elem
Found
Found
length s == 64 || length s == 75Why not
(length s `elem` [64, 75])
src/Darcs/Repository/Cache.hs:172:56: Warning: Redundant bracket
Found
Found
(hashedDir s) ++ "/" ++ fWhy not
hashedDir s ++ "/" ++ f
src/Darcs/Repository/Cache.hs:174:32: Warning: Redundant bracket
Found
Found
(hashedDir s) ++ "/" ++ fWhy not
hashedDir s ++ "/" ++ f
src/Darcs/Repository/Cache.hs:212:59: Warning: Redundant bracket
Found
Found
(hashedDir subdir) ++ "/" ++ fWhy not
hashedDir subdir ++ "/" ++ f
src/Darcs/Repository/Cache.hs:215:35: Warning: Redundant bracket
Found
Found
(flip sfuc) stickItHereWhy not
flip sfuc stickItHere
src/Darcs/Repository/Cache.hs:312:18: Warning: Redundant $
Found
Found
debugMessage $ "In fetchFileUsingCachePrivate I'm going manually"Why not
debugMessage "In fetchFileUsingCachePrivate I'm going manually"
src/Darcs/Repository/Cache.hs:318:29: Error: Use unless
Found
Found
when (not $ checkHash f x')Why not
unless (checkHash f x')
src/Darcs/Repository/Cache.hs:332:31: Error: Use unless
Found
Found
when (not $ checkHash f x2)Why not
unless (checkHash f x2)
src/Darcs/Repository/Cache.hs:354:53: Warning: Redundant bracket
Found
Found
"/" ++ (hashedDir subdir)Why not
"/" ++ hashedDir subdir
src/Darcs/Repository/Cache.hs:362:41: Warning: Redundant bracket
Found
Found
"/" ++ (hashedDir subdir)Why not
"/" ++ hashedDir subdir
src/Darcs/Repository/Cache.hs:379:64: Warning: Redundant bracket
Found
Found
(hashedDir subdir) ++ " to sources:\n\n" ++ show (Ca cache)Why not
hashedDir subdir ++ " to sources:\n\n" ++ show (Ca cache)
src/Darcs/Repository/Cache.hs:386:66: Warning: Redundant bracket
Found
Found
(hashedDir subdir) ++ "/" ++ hash ++ "'"Why not
hashedDir subdir ++ "/" ++ hash ++ "'"
src/Darcs/Repository/Cache.hs:398:14: Warning: Redundant $
Found
Found
(withCurrentDirectory (d ++ "/" ++ (hashedDir subdir)) $ do fs' <- getDirectoryContents "." let fs = fromMaybe fs' hint mapM_ clean $ progressList ("Cleaning cache " ++ d ++ "/" ++ (hashedDir subdir)) $ filter okayHash fs) `catchall` return ()Why not
withCurrentDirectory (d ++ "/" ++ (hashedDir subdir)) (do fs' <- getDirectoryContents "." let fs = fromMaybe fs' hint mapM_ clean $ progressList ("Cleaning cache " ++ d ++ "/" ++ (hashedDir subdir)) $ filter okayHash fs) `catchall` return ()
src/Darcs/Repository/Cache.hs:398:40: Warning: Redundant bracket
Found
Found
"/" ++ (hashedDir subdir)Why not
"/" ++ hashedDir subdir
src/Darcs/Repository/Cache.hs:401:68: Warning: Redundant bracket
Found
Found
"/" ++ (hashedDir subdir)Why not
"/" ++ hashedDir subdir
src/Darcs/Repository/Cache.hs:415:12: Warning: Redundant bracket
Found
Found
["\nHINT: I could not reach the following ", englishNum size (Noun "repository") ":", "\n", (intercalate "\n" (map (" " ++) sources)), "\n If you're not using ", englishNum size It ", you should probably delete", "\n the corresponding ", englishNum size (Noun "entry") " from _darcs/prefs/sources."]Why not
["\nHINT: I could not reach the following ", englishNum size (Noun "repository") ":", "\n", intercalate "\n" (map (" " ++) sources), "\n If you're not using ", englishNum size It ", you should probably delete", "\n the corresponding ", englishNum size (Noun "entry") " from _darcs/prefs/sources."]
src/Darcs/Repository/Repair.hs:17:1: Error: Use fewer imports
Found
Found
import Darcs.Lock (rmRecursive) import Darcs.Lock (withTempDir)Why not
import Darcs.Lock (rmRecursive, withTempDir)
src/Darcs/Repository/Repair.hs:19:1: Error: Use fewer imports
Found
Found
import Darcs.Patch.PatchInfoAnd (PatchInfoAnd, info, winfo, WPatchInfo, unWPatchInfo, compareWPatchInfo) import Darcs.Patch.PatchInfoAnd (hopefully)Why not
import Darcs.Patch.PatchInfoAnd (PatchInfoAnd, info, winfo, WPatchInfo, unWPatchInfo, compareWPatchInfo, hopefully)
src/Darcs/Repository/Repair.hs:52:1: Error: Use fewer imports
Found
Found
import Storage.Hashed.Darcs (hashedTreeIO) import Storage.Hashed.Darcs (darcsUpdateHashes)Why not
import Storage.Hashed.Darcs (hashedTreeIO, darcsUpdateHashes)
src/Darcs/Repository/Repair.hs:53:1: Error: Use fewer imports
Found
Found
import Storage.Hashed.Tree (Tree, emptyTree) import Storage.Hashed.Tree (list, restrict, expand, itemHash, zipTrees)Why not
import Storage.Hashed.Tree (Tree, emptyTree, list, restrict, expand, itemHash, zipTrees)
src/Darcs/Repository/Repair.hs:130:19: Error: Use unless
Found
Found
when (not $ Quiet `elem` opts)Why not
unless (Quiet `elem` opts)
src/Darcs/Repository/Repair.hs:130:25: Error: Use notElem
Found
Found
not $ Quiet `elem` optsWhy not
notElem Quiet opts
src/Darcs/Repository/Repair.hs:179:28: Error: Redundant do
Found
Found
do run `finally` cleanupRepositoryReplay rWhy not
run `finally` cleanupRepositoryReplay r
src/Darcs/Repository/Repair.hs:203:33: Warning: Redundant $
Found
Found
map $ ((" " ++) . anchorPath "")Why not
map ((" " ++) . anchorPath "")
src/Darcs/Repository/Internal.hs:83:1: Error: Use fewer imports
Found
Found
import Darcs.Repository.Prefs (getPrefval) import Darcs.Repository.Prefs (getCaches)Why not
import Darcs.Repository.Prefs (getPrefval, getCaches)
src/Darcs/Repository/Internal.hs:138:1: Error: Use fewer imports
Found
Found
import Darcs.Patch (Effect, primIsHunk, primIsBinary, description, tryToShrink, commuteFLorComplain, commute, fromPrim) import Darcs.Patch (RepoPatch, Patchy, merge, listConflictedFiles, listTouchedFiles, Named, commuteRL, fromPrims, readPatch, effect, invert, primIsAddfile, primIsAdddir, primIsSetpref, apply, applyToTree)Why not
import Darcs.Patch (Effect, primIsHunk, primIsBinary, description, tryToShrink, commuteFLorComplain, commute, fromPrim, RepoPatch, Patchy, merge, listConflictedFiles, listTouchedFiles, Named, commuteRL, fromPrims, readPatch, effect, invert, primIsAddfile, primIsAdddir, primIsSetpref, apply, applyToTree)
src/Darcs/Repository/Internal.hs:367:8: Warning: Redundant $
Found
Found
setCurrentDirectory d `catchall` (fail $ "can't set directory to " ++ d)Why not
setCurrentDirectory d `catchall` fail ("can't set directory to " ++ d)
src/Darcs/Repository/Internal.hs:373:10: Error: Redundant do
Found
Found
do maybe (Left "You need to be in a repository directory to run this command.") id <$> seekRepoWhy not
maybe (Left "You need to be in a repository directory to run this command.") id <$> seekRepo
src/Darcs/Repository/Internal.hs:373:13: Error: Use fromMaybe
Found
Found
maybe (Left "You need to be in a repository directory to run this command.") idWhy not
Data.Maybe.fromMaybe (Left "You need to be in a repository directory to run this command.")
src/Darcs/Repository/Internal.hs:414:25: Error: Redundant do
Found
Found
do case [d | WorkRepoDir d <- dfs] of (d : _) -> do createDirectoryIfMissing False d `catchall` (performGC >> createDirectoryIfMissing False d) setCurrentDirectory d amNotInRepository [] [] -> do status <- maybeIdentifyRepository [] "." case status of GoodRepository _ -> return (Left $ "You may not run this command in a repository.") BadRepository e -> return (Left $ "You may not run this command in a repository.\nBy the way, we have a problem with it:\n" ++ e) NonRepository _ -> return (Right ())Why not
case [d | WorkRepoDir d <- dfs] of (d : _) -> do createDirectoryIfMissing False d `catchall` (performGC >> createDirectoryIfMissing False d) setCurrentDirectory d amNotInRepository [] [] -> do status <- maybeIdentifyRepository [] "." case status of GoodRepository _ -> return (Left $ "You may not run this command in a repository.") BadRepository e -> return (Left $ "You may not run this command in a repository.\nBy the way, we have a problem with it:\n" ++ e) NonRepository _ -> return (Right ())
src/Darcs/Repository/Internal.hs:425:38: Warning: Redundant $
Found
Found
Left $ "You may not run this command in a repository."Why not
Left "You may not run this command in a repository."
src/Darcs/Repository/Internal.hs:431:8: Warning: Redundant $
Found
Found
setCurrentDirectory d `catchall` (fail $ "can't set directory to " ++ d)Why not
setCurrentDirectory d `catchall` fail ("can't set directory to " ++ d)
src/Darcs/Repository/Internal.hs:434:8: Warning: Redundant $
Found
Found
setCurrentDirectory d `catchall` (fail $ "can't set directory to " ++ d)Why not
setCurrentDirectory d `catchall` fail ("can't set directory to " ++ d)
src/Darcs/Repository/Internal.hs:437:21: Error: Use fromMaybe
Found
Found
maybe (Right ()) idWhy not
Data.Maybe.fromMaybe (Right ())
src/Darcs/Repository/Internal.hs:456:13: Error: Use Control.Exception.catch
Found
Found
catch
Why notControl.Exception.catchNote: Prelude.catch does not catch most exceptions
src/Darcs/Repository/Internal.hs:468:14: Error: Use fromMaybe
Found
Found
maybe simple_ps idWhy not
Data.Maybe.fromMaybe simple_ps
src/Darcs/Repository/Internal.hs:469:8: Warning: Redundant $
Found
Found
allFL (\ p -> primIsAddfile p || primIsAdddir p) $ oldpsWhy not
allFL (\ p -> primIsAddfile p || primIsAdddir p) oldps
src/Darcs/Repository/Internal.hs:651:8: Warning: Redundant $
Found
Found
decideHashedOrNormal rf $ HvsO{hashed = void $ HashedRepo.addToTentativeInventory c compr p, old = fail Old.oldRepoFailMsg}Why not
decideHashedOrNormal rf HvsO{hashed = void $ HashedRepo.addToTentativeInventory c compr p, old = fail Old.oldRepoFailMsg}
src/Darcs/Repository/Internal.hs:667:8: Warning: Redundant $
Found
Found
decideHashedOrNormal rf $ HvsO{hashed = HashedRepo.applyToTentativePristine p, old = fail Old.oldRepoFailMsg}Why not
decideHashedOrNormal rf HvsO{hashed = HashedRepo.applyToTentativePristine p, old = fail Old.oldRepoFailMsg}
src/Darcs/Repository/Internal.hs:761:36: Warning: Redundant bracket
Found
Found
removeFileMayNotExist $ (pendingName rt)Why not
removeFileMayNotExist $ pendingName rt
src/Darcs/Repository/Internal.hs:761:36: Warning: Redundant $
Found
Found
removeFileMayNotExist $ (pendingName rt)Why not
removeFileMayNotExist (pendingName rt)
src/Darcs/Repository/Internal.hs:762:47: Error: Redundant do
Found
Found
do withCurrentDirectory dir $ do Sealed tpend <- readTentativePending repository Sealed new_pending <- return $ siftForPending tpend makeNewPending repository new_pendingWhy not
withCurrentDirectory dir $ do Sealed tpend <- readTentativePending repository Sealed new_pending <- return $ siftForPending tpend makeNewPending repository new_pending
src/Darcs/Repository/Internal.hs:783:84: Error: Redundant bracket
Found
Found
(ExitCode)Why not
ExitCode
src/Darcs/Repository/Internal.hs:788:16: Warning: Redundant bracket
Found
Found
((AbsolutePath -> IO ExitCode) -> IO ExitCode) -> ((AbsolutePath -> IO ExitCode) -> IO ExitCode)Why not
((AbsolutePath -> IO ExitCode) -> IO ExitCode) -> (AbsolutePath -> IO ExitCode) -> IO ExitCode
src/Darcs/Repository/Internal.hs:795:8: Error: Use notElem
Found
Found
not $ Test `elem` optsWhy not
notElem Test opts
src/Darcs/Repository/Internal.hs:821:8: Warning: Redundant $
Found
Found
decideHashedOrNormal rf $ HvsO{hashed = HashedRepo.revertTentativeChanges, old = Old.revertTentativeChanges}Why not
decideHashedOrNormal rf HvsO{hashed = HashedRepo.revertTentativeChanges, old = Old.revertTentativeChanges}
src/Darcs/Repository/Internal.hs:847:47: Warning: Redundant bracket
Found
Found
(Repository p wR wU wR -> IO a) -> (Repository p wR wU wR -> IO a)Why not
(Repository p wR wU wR -> IO a) -> Repository p wR wU wR -> IO a
src/Darcs/Repository/Internal.hs:912:20: Warning: Redundant $
Found
Found
unrevert_patch_bundle `catchall` (return $ seal (PatchSet NilRL NilRL))Why not
unrevert_patch_bundle `catchall` return (seal (PatchSet NilRL NilRL))
src/Darcs/Repository/Internal.hs:948:5: Warning: Redundant $
Found
Found
decideHashedOrNormal rf $ HvsO{hashed = HashedRepo.cleanPristine repository, old = fail Old.oldRepoFailMsg}Why not
decideHashedOrNormal rf HvsO{hashed = HashedRepo.cleanPristine repository, old = fail Old.oldRepoFailMsg}
src/Darcs/Repository/Internal.hs:1002:42: Error: Use fromMaybe
Found
Found
maybe (seal NilFL) idWhy not
Data.Maybe.fromMaybe (seal NilFL)
src/Darcs/Repository/Internal.hs:1044:52: Error: Redundant do
Found
Found
do decideHashedOrNormal rf $ HvsO{hashed = do debugMessage "Reordering the inventory." PatchSet ps _ <- chooseOrder `fmap` readRepo repository tentativelyReplacePatches repository (compression opts) $ reverseRL ps HashedRepo.finalizeTentativeChanges repository (compression opts) debugMessage "Done reordering the inventory.", old = fail Old.oldRepoFailMsg}Why not
decideHashedOrNormal rf $ HvsO{hashed = do debugMessage "Reordering the inventory." PatchSet ps _ <- chooseOrder `fmap` readRepo repository tentativelyReplacePatches repository (compression opts) $ reverseRL ps HashedRepo.finalizeTentativeChanges repository (compression opts) debugMessage "Done reordering the inventory.", old = fail Old.oldRepoFailMsg}
src/Darcs/Repository/Internal.hs:1045:5: Warning: Redundant $
Found
Found
decideHashedOrNormal rf $ HvsO{hashed = do debugMessage "Reordering the inventory." PatchSet ps _ <- chooseOrder `fmap` readRepo repository tentativelyReplacePatches repository (compression opts) $ reverseRL ps HashedRepo.finalizeTentativeChanges repository (compression opts) debugMessage "Done reordering the inventory.", old = fail Old.oldRepoFailMsg}Why not
decideHashedOrNormal rf HvsO{hashed = do debugMessage "Reordering the inventory." PatchSet ps _ <- chooseOrder `fmap` readRepo repository tentativelyReplacePatches repository (compression opts) $ reverseRL ps HashedRepo.finalizeTentativeChanges repository (compression opts) debugMessage "Done reordering the inventory.", old = fail Old.oldRepoFailMsg}
src/Darcs/Repository/HashedIO.hs:168:16: Warning: Reduce duplication
Found
Found
hd <- get put $ hd{rootHash = h} x <- jWhy not
Combine with src/Darcs/Repository/HashedIO.hs:176:14
src/Darcs/Repository/HashedIO.hs:61:61: Warning: Redundant bracket
Found
Found
(hashedDir subdir) ++ "/"Why not
hashedDir subdir ++ "/"
src/Darcs/Repository/HashedIO.hs:185:15: Error: Use unless
Found
Found
when (not haveitalready)Why not
unless haveitalready
src/Darcs/Repository/HashedIO.hs:261:15: Warning: Redundant $
Found
Found
runStateT (cp $ fp2fn $ toFilePath ff) $ HashDir{permissions = RW, cache = c, compress = compr, rootHash = root}Why not
runStateT (cp $ fp2fn $ toFilePath ff) HashDir{permissions = RW, cache = c, compress = compr, rootHash = root}
src/Darcs/Repository/HashedIO.hs:276:41: Warning: Redundant bracket
Found
Found
(hashedDir dir_) ++ "..."Why not
hashedDir dir_ ++ "..."
src/Darcs/Repository/HashedIO.hs:277:40: Warning: Redundant bracket
Found
Found
(hashedDir dir_) ++ "/"Why not
hashedDir dir_ ++ "/"
src/Darcs/Repository/State.hs:96:16: Warning: Redundant bracket
Found
Found
paths `union` (effectOnFilePaths pending paths)Why not
paths `union` effectOnFilePaths pending paths
src/Darcs/Repository/State.hs:159:5: Warning: Redundant bracket
Found
Found
(formatHas NoWorkingDir rf)Why not
formatHas NoWorkingDir rf
src/Darcs/Repository/State.hs:195:27: Warning: Redundant bracket
Found
Found
Repository p wR wU wT -> (EqCheck wU wT)Why not
Repository p wR wU wT -> EqCheck wU wT
src/Darcs/Repository/State.hs:260:6: Error: Use Control.Exception.catch
Found
Found
catch
Why notControl.Exception.catchNote: Prelude.catch does not catch most exceptions
src/Darcs/Repository/State.hs:262:8: Warning: Redundant $
Found
Found
putStrLn $ "Stashing the buggy pending as _darcs/patches/pending_buggy"Why not
putStrLn "Stashing the buggy pending as _darcs/patches/pending_buggy"
src/Darcs/Repository/State.hs:273:21: Error: Redundant do
Found
Found
do BS.writeFile "_darcs/index_invalid" BS.emptyWhy not
BS.writeFile "_darcs/index_invalid" BS.empty
src/Darcs/Repository/State.hs:289:3: Warning: Redundant bracket
Found
Found
if (not exist || invalid || not format_valid) then do pris <- readRecordedAndPending repo idx <- I.updateIndexFrom "_darcs/index" darcsTreeHash pris when invalid $ removeFile "_darcs/index_invalid" return idx else I.readIndex "_darcs/index" darcsTreeHashWhy not
if not exist || invalid || not format_valid then do pris <- readRecordedAndPending repo idx <- I.updateIndexFrom "_darcs/index" darcsTreeHash pris when invalid $ removeFile "_darcs/index_invalid" return idx else I.readIndex "_darcs/index" darcsTreeHash
src/win32/CtrlC.hs:18:5: Warning: Use bracket_
Found
Found
bracket (setConsoleCtrlHandler fp 1) (const $ setConsoleCtrlHandler fp 0) (const m)Why not
(Control.Exception.bracket_ (setConsoleCtrlHandler fp 1) (setConsoleCtrlHandler fp 0) m)
src/URL/Curl.hs:25:30: Error: Redundant return
Found
Found
do err <- curl_request_url ustr fstr (cachableToInt cache) >>= peekCString return errWhy not
do curl_request_url ustr fstr (cachableToInt cache) >>= peekCString