diff --git a/Commands/UI.hs b/Commands/UI.hs index fde0299b0..bc10d6a2e 100644 --- a/Commands/UI.hs +++ b/Commands/UI.hs @@ -251,7 +251,7 @@ accountNameAt buf lineno = accountNameFromComponents anamecomponents anamecomponents = reverse $ map strip $ dropsiblings thisbranch dropsiblings :: [AccountName] -> [AccountName] dropsiblings [] = [] - dropsiblings (x:xs) = [x] ++ dropsiblings xs' + dropsiblings (x:xs) = x : dropsiblings xs' where xs' = dropWhile moreindented xs moreindented = (>= myindent) . indentof @@ -278,7 +278,7 @@ currentLedgerTransaction a@AppState{aledger=l,abuf=buf} = entryContainingTransac t = safehead nulltxn $ filter ismatch $ ledgerTransactions l ismatch t = tdate t == parsedate (take 10 datedesc) && 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 safehead d ls = if null ls then d else head ls (above,rest) = splitAt y buf diff --git a/Ledger/AccountName.hs b/Ledger/AccountName.hs index 7dd7893af..b0cafa6ae 100644 --- a/Ledger/AccountName.hs +++ b/Ledger/AccountName.hs @@ -47,7 +47,7 @@ parentAccountNames :: AccountName -> [AccountName] parentAccountNames a = parentAccountNames' $ parentAccountName a where parentAccountNames' "" = [] - parentAccountNames' a = [a] ++ parentAccountNames' (parentAccountName a) + parentAccountNames' a = a : parentAccountNames' (parentAccountName a) isAccountNamePrefixOf :: AccountName -> AccountName -> Bool isAccountNamePrefixOf = isPrefixOf . (++ [acctsepchar]) diff --git a/Ledger/Amount.hs b/Ledger/Amount.hs index 7d006203b..6d7dffb4a 100644 --- a/Ledger/Amount.hs +++ b/Ledger/Amount.hs @@ -128,7 +128,7 @@ punctuatethousands s = (int,frac) = break (=='.') num addcommas = reverse . concat . intersperse "," . triples . reverse 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 ? isZeroAmount :: Amount -> Bool diff --git a/Ledger/Dates.hs b/Ledger/Dates.hs index 919205f0d..dc1915d83 100644 --- a/Ledger/Dates.hs +++ b/Ledger/Dates.hs @@ -60,8 +60,8 @@ splitspan start next span@(DateSpan (Just b) (Just e)) where splitspan' start next (DateSpan (Just b) (Just e)) | b >= e = [] - | otherwise = [DateSpan (Just s) (Just n)] - ++ splitspan' start next (DateSpan (Just n) (Just e)) + | otherwise = DateSpan (Just s) (Just n) + : splitspan' start next (DateSpan (Just n) (Just e)) where s = start b n = next s splitspan' _ _ _ = error "won't happen, avoids warnings" diff --git a/Ledger/LedgerTransaction.hs b/Ledger/LedgerTransaction.hs index 8b242c5d4..14526b6c3 100644 --- a/Ledger/LedgerTransaction.hs +++ b/Ledger/LedgerTransaction.hs @@ -68,7 +68,7 @@ showLedgerTransaction' elide effective t = | otherwise = showdate (ltdate t) ++ maybe "" showedate (lteffectivedate t) status = if ltstatus t then " *" else "" code = if length (ltcode t) > 0 then printf " (%s)" $ ltcode t else "" - desc = " " ++ ltdescription t + desc = ' ' : ltdescription t showdate = printf "%-10s" . showDate showedate = printf "=%s" . showdate showpostings ps diff --git a/Ledger/TimeLog.hs b/Ledger/TimeLog.hs index 2e14de292..0b25bf8ef 100644 --- a/Ledger/TimeLog.hs +++ b/Ledger/TimeLog.hs @@ -38,7 +38,7 @@ instance Read TimeLogCode where entriesFromTimeLogEntries :: LocalTime -> [TimeLogEntry] -> [LedgerTransaction] entriesFromTimeLogEntries _ [] = [] 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] where o = TimeLogEntry Out end "" @@ -48,8 +48,8 @@ entriesFromTimeLogEntries now [i] o' = o{tldatetime=itime{localDay=idate, localTimeOfDay=TimeOfDay 23 59 59}} i' = i{tldatetime=itime{localDay=addDays 1 idate, localTimeOfDay=midnight}} entriesFromTimeLogEntries now (i:o:rest) - | odate > idate = [entryFromTimeLogInOut i o'] ++ entriesFromTimeLogEntries now (i':o:rest) - | otherwise = [entryFromTimeLogInOut i o] ++ entriesFromTimeLogEntries now rest + | odate > idate = entryFromTimeLogInOut i o' : entriesFromTimeLogEntries now (i':o:rest) + | otherwise = entryFromTimeLogInOut i o : entriesFromTimeLogEntries now rest where (itime,otime) = (tldatetime i,tldatetime o) (idate,odate) = (localDay itime,localDay otime) diff --git a/Version.hs b/Version.hs index 75d0b3db0..27cd956a1 100644 --- a/Version.hs +++ b/Version.hs @@ -28,9 +28,9 @@ binaryfilename = prettify $ splitAtElement '.' buildversion :: String where bugfix' | bugfix `elem` ["0"{-,"98","99"-}] = "" - | otherwise = "."++bugfix + | otherwise = '.' : bugfix patches' - | patches/="0" = "+"++patches + | patches/="0" = '+' : patches | otherwise = "" (os',suffix) | os == "darwin" = ("mac","") @@ -49,7 +49,7 @@ versionstr = prettify $ splitAtElement '.' buildversion :: String where bugfix' | bugfix `elem` ["0"{-,"98","99"-}] = "" - | otherwise = "."++bugfix + | otherwise = '.' : bugfix patches' | patches/="0" = "+"++patches | otherwise = "" diff --git a/tools/bench.hs b/tools/bench.hs index 712c6b727..c3f65b5c0 100644 --- a/tools/bench.hs +++ b/tools/bench.hs @@ -112,7 +112,7 @@ parseargs as = optValueWithDefault :: (String -> Opt) -> String -> [Opt] -> String optValueWithDefault optcons def opts = - last $ [def] ++ optValuesForConstructor optcons opts + last $ def : optValuesForConstructor optcons opts optValuesForConstructor :: (String -> Opt) -> [Opt] -> [String] optValuesForConstructor optcons opts = concatMap get opts diff --git a/tools/doctest.hs b/tools/doctest.hs index a0ca4350d..463167bb1 100644 --- a/tools/doctest.hs +++ b/tools/doctest.hs @@ -76,7 +76,7 @@ doctests s = filter isDocTest $ haddockLiterals s haddockLiterals :: String -> [String] haddockLiterals "" = [] haddockLiterals s | null lit = [] - | otherwise = [lit] ++ haddockLiterals rest + | otherwise = lit : haddockLiterals rest where ls = drop 1 $ dropWhile (not . isLiteralBoundary) $ lines s lit = unlines $ takeWhile (not . isLiteralBoundary) ls diff --git a/tools/generateledger.hs b/tools/generateledger.hs index b578c797d..f2507ee22 100644 --- a/tools/generateledger.hs +++ b/tools/generateledger.hs @@ -45,7 +45,7 @@ uniqueacctnames' depth uniquenames = group some ++ uniqueacctnames' depth rest -- group ["a", "b", "c"] = ["a","a:b","a:b:c"] group :: [String] -> [String] group [] = [] -group (a:as) = [a] ++ map ((a++":")++) (group as) +group (a:as) = a : map ((a++":")++) (group as) pair :: [a] -> [(a,a)] pair [] = []