Hlint: Warning: Use :
This commit is contained in:
parent
1bac7a92af
commit
c6eac33d32
@ -251,7 +251,7 @@ accountNameAt buf lineno = accountNameFromComponents anamecomponents
|
|||||||
anamecomponents = reverse $ map strip $ dropsiblings thisbranch
|
anamecomponents = reverse $ map strip $ dropsiblings thisbranch
|
||||||
dropsiblings :: [AccountName] -> [AccountName]
|
dropsiblings :: [AccountName] -> [AccountName]
|
||||||
dropsiblings [] = []
|
dropsiblings [] = []
|
||||||
dropsiblings (x:xs) = [x] ++ dropsiblings xs'
|
dropsiblings (x:xs) = x : dropsiblings xs'
|
||||||
where
|
where
|
||||||
xs' = dropWhile moreindented xs
|
xs' = dropWhile moreindented xs
|
||||||
moreindented = (>= myindent) . indentof
|
moreindented = (>= myindent) . indentof
|
||||||
@ -278,7 +278,7 @@ currentLedgerTransaction a@AppState{aledger=l,abuf=buf} = entryContainingTransac
|
|||||||
t = safehead nulltxn $ filter ismatch $ ledgerTransactions l
|
t = safehead nulltxn $ filter ismatch $ ledgerTransactions l
|
||||||
ismatch t = tdate t == parsedate (take 10 datedesc)
|
ismatch t = tdate t == parsedate (take 10 datedesc)
|
||||||
&& take 70 (showtxn False t nullmixedamt) == (datedesc ++ acctamt)
|
&& take 70 (showtxn False t nullmixedamt) == (datedesc ++ acctamt)
|
||||||
datedesc = take 32 $ fromMaybe "" $ find (not . (" " `isPrefixOf`)) $ [safehead "" rest] ++ reverse above
|
datedesc = take 32 $ fromMaybe "" $ find (not . (" " `isPrefixOf`)) $ safehead "" rest : reverse above
|
||||||
acctamt = drop 32 $ safehead "" rest
|
acctamt = drop 32 $ safehead "" rest
|
||||||
safehead d ls = if null ls then d else head ls
|
safehead d ls = if null ls then d else head ls
|
||||||
(above,rest) = splitAt y buf
|
(above,rest) = splitAt y buf
|
||||||
|
|||||||
@ -47,7 +47,7 @@ parentAccountNames :: AccountName -> [AccountName]
|
|||||||
parentAccountNames a = parentAccountNames' $ parentAccountName a
|
parentAccountNames a = parentAccountNames' $ parentAccountName a
|
||||||
where
|
where
|
||||||
parentAccountNames' "" = []
|
parentAccountNames' "" = []
|
||||||
parentAccountNames' a = [a] ++ parentAccountNames' (parentAccountName a)
|
parentAccountNames' a = a : parentAccountNames' (parentAccountName a)
|
||||||
|
|
||||||
isAccountNamePrefixOf :: AccountName -> AccountName -> Bool
|
isAccountNamePrefixOf :: AccountName -> AccountName -> Bool
|
||||||
isAccountNamePrefixOf = isPrefixOf . (++ [acctsepchar])
|
isAccountNamePrefixOf = isPrefixOf . (++ [acctsepchar])
|
||||||
|
|||||||
@ -128,7 +128,7 @@ punctuatethousands s =
|
|||||||
(int,frac) = break (=='.') num
|
(int,frac) = break (=='.') num
|
||||||
addcommas = reverse . concat . intersperse "," . triples . reverse
|
addcommas = reverse . concat . intersperse "," . triples . reverse
|
||||||
triples [] = []
|
triples [] = []
|
||||||
triples l = [take 3 l] ++ triples (drop 3 l)
|
triples l = take 3 l : triples (drop 3 l)
|
||||||
|
|
||||||
-- | Does this amount appear to be zero when displayed with its given precision ?
|
-- | Does this amount appear to be zero when displayed with its given precision ?
|
||||||
isZeroAmount :: Amount -> Bool
|
isZeroAmount :: Amount -> Bool
|
||||||
|
|||||||
@ -60,8 +60,8 @@ splitspan start next span@(DateSpan (Just b) (Just e))
|
|||||||
where
|
where
|
||||||
splitspan' start next (DateSpan (Just b) (Just e))
|
splitspan' start next (DateSpan (Just b) (Just e))
|
||||||
| b >= e = []
|
| b >= e = []
|
||||||
| otherwise = [DateSpan (Just s) (Just n)]
|
| otherwise = DateSpan (Just s) (Just n)
|
||||||
++ splitspan' start next (DateSpan (Just n) (Just e))
|
: splitspan' start next (DateSpan (Just n) (Just e))
|
||||||
where s = start b
|
where s = start b
|
||||||
n = next s
|
n = next s
|
||||||
splitspan' _ _ _ = error "won't happen, avoids warnings"
|
splitspan' _ _ _ = error "won't happen, avoids warnings"
|
||||||
|
|||||||
@ -68,7 +68,7 @@ showLedgerTransaction' elide effective t =
|
|||||||
| otherwise = showdate (ltdate t) ++ maybe "" showedate (lteffectivedate t)
|
| otherwise = showdate (ltdate t) ++ maybe "" showedate (lteffectivedate t)
|
||||||
status = if ltstatus t then " *" else ""
|
status = if ltstatus t then " *" else ""
|
||||||
code = if length (ltcode t) > 0 then printf " (%s)" $ ltcode t else ""
|
code = if length (ltcode t) > 0 then printf " (%s)" $ ltcode t else ""
|
||||||
desc = " " ++ ltdescription t
|
desc = ' ' : ltdescription t
|
||||||
showdate = printf "%-10s" . showDate
|
showdate = printf "%-10s" . showDate
|
||||||
showedate = printf "=%s" . showdate
|
showedate = printf "=%s" . showdate
|
||||||
showpostings ps
|
showpostings ps
|
||||||
|
|||||||
@ -38,7 +38,7 @@ instance Read TimeLogCode where
|
|||||||
entriesFromTimeLogEntries :: LocalTime -> [TimeLogEntry] -> [LedgerTransaction]
|
entriesFromTimeLogEntries :: LocalTime -> [TimeLogEntry] -> [LedgerTransaction]
|
||||||
entriesFromTimeLogEntries _ [] = []
|
entriesFromTimeLogEntries _ [] = []
|
||||||
entriesFromTimeLogEntries now [i]
|
entriesFromTimeLogEntries now [i]
|
||||||
| odate > idate = [entryFromTimeLogInOut i o'] ++ entriesFromTimeLogEntries now [i',o]
|
| odate > idate = entryFromTimeLogInOut i o' : entriesFromTimeLogEntries now [i',o]
|
||||||
| otherwise = [entryFromTimeLogInOut i o]
|
| otherwise = [entryFromTimeLogInOut i o]
|
||||||
where
|
where
|
||||||
o = TimeLogEntry Out end ""
|
o = TimeLogEntry Out end ""
|
||||||
@ -48,8 +48,8 @@ entriesFromTimeLogEntries now [i]
|
|||||||
o' = o{tldatetime=itime{localDay=idate, localTimeOfDay=TimeOfDay 23 59 59}}
|
o' = o{tldatetime=itime{localDay=idate, localTimeOfDay=TimeOfDay 23 59 59}}
|
||||||
i' = i{tldatetime=itime{localDay=addDays 1 idate, localTimeOfDay=midnight}}
|
i' = i{tldatetime=itime{localDay=addDays 1 idate, localTimeOfDay=midnight}}
|
||||||
entriesFromTimeLogEntries now (i:o:rest)
|
entriesFromTimeLogEntries now (i:o:rest)
|
||||||
| odate > idate = [entryFromTimeLogInOut i o'] ++ entriesFromTimeLogEntries now (i':o:rest)
|
| odate > idate = entryFromTimeLogInOut i o' : entriesFromTimeLogEntries now (i':o:rest)
|
||||||
| otherwise = [entryFromTimeLogInOut i o] ++ entriesFromTimeLogEntries now rest
|
| otherwise = entryFromTimeLogInOut i o : entriesFromTimeLogEntries now rest
|
||||||
where
|
where
|
||||||
(itime,otime) = (tldatetime i,tldatetime o)
|
(itime,otime) = (tldatetime i,tldatetime o)
|
||||||
(idate,odate) = (localDay itime,localDay otime)
|
(idate,odate) = (localDay itime,localDay otime)
|
||||||
|
|||||||
@ -28,9 +28,9 @@ binaryfilename = prettify $ splitAtElement '.' buildversion :: String
|
|||||||
where
|
where
|
||||||
bugfix'
|
bugfix'
|
||||||
| bugfix `elem` ["0"{-,"98","99"-}] = ""
|
| bugfix `elem` ["0"{-,"98","99"-}] = ""
|
||||||
| otherwise = "."++bugfix
|
| otherwise = '.' : bugfix
|
||||||
patches'
|
patches'
|
||||||
| patches/="0" = "+"++patches
|
| patches/="0" = '+' : patches
|
||||||
| otherwise = ""
|
| otherwise = ""
|
||||||
(os',suffix)
|
(os',suffix)
|
||||||
| os == "darwin" = ("mac","")
|
| os == "darwin" = ("mac","")
|
||||||
@ -49,7 +49,7 @@ versionstr = prettify $ splitAtElement '.' buildversion :: String
|
|||||||
where
|
where
|
||||||
bugfix'
|
bugfix'
|
||||||
| bugfix `elem` ["0"{-,"98","99"-}] = ""
|
| bugfix `elem` ["0"{-,"98","99"-}] = ""
|
||||||
| otherwise = "."++bugfix
|
| otherwise = '.' : bugfix
|
||||||
patches'
|
patches'
|
||||||
| patches/="0" = "+"++patches
|
| patches/="0" = "+"++patches
|
||||||
| otherwise = ""
|
| otherwise = ""
|
||||||
|
|||||||
@ -112,7 +112,7 @@ parseargs as =
|
|||||||
|
|
||||||
optValueWithDefault :: (String -> Opt) -> String -> [Opt] -> String
|
optValueWithDefault :: (String -> Opt) -> String -> [Opt] -> String
|
||||||
optValueWithDefault optcons def opts =
|
optValueWithDefault optcons def opts =
|
||||||
last $ [def] ++ optValuesForConstructor optcons opts
|
last $ def : optValuesForConstructor optcons opts
|
||||||
|
|
||||||
optValuesForConstructor :: (String -> Opt) -> [Opt] -> [String]
|
optValuesForConstructor :: (String -> Opt) -> [Opt] -> [String]
|
||||||
optValuesForConstructor optcons opts = concatMap get opts
|
optValuesForConstructor optcons opts = concatMap get opts
|
||||||
|
|||||||
@ -76,7 +76,7 @@ doctests s = filter isDocTest $ haddockLiterals s
|
|||||||
haddockLiterals :: String -> [String]
|
haddockLiterals :: String -> [String]
|
||||||
haddockLiterals "" = []
|
haddockLiterals "" = []
|
||||||
haddockLiterals s | null lit = []
|
haddockLiterals s | null lit = []
|
||||||
| otherwise = [lit] ++ haddockLiterals rest
|
| otherwise = lit : haddockLiterals rest
|
||||||
where
|
where
|
||||||
ls = drop 1 $ dropWhile (not . isLiteralBoundary) $ lines s
|
ls = drop 1 $ dropWhile (not . isLiteralBoundary) $ lines s
|
||||||
lit = unlines $ takeWhile (not . isLiteralBoundary) ls
|
lit = unlines $ takeWhile (not . isLiteralBoundary) ls
|
||||||
|
|||||||
@ -45,7 +45,7 @@ uniqueacctnames' depth uniquenames = group some ++ uniqueacctnames' depth rest
|
|||||||
-- group ["a", "b", "c"] = ["a","a:b","a:b:c"]
|
-- group ["a", "b", "c"] = ["a","a:b","a:b:c"]
|
||||||
group :: [String] -> [String]
|
group :: [String] -> [String]
|
||||||
group [] = []
|
group [] = []
|
||||||
group (a:as) = [a] ++ map ((a++":")++) (group as)
|
group (a:as) = a : map ((a++":")++) (group as)
|
||||||
|
|
||||||
pair :: [a] -> [(a,a)]
|
pair :: [a] -> [(a,a)]
|
||||||
pair [] = []
|
pair [] = []
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user