Hlint: Error: Monad law, left identity

This commit is contained in:
marko.kocic 2009-09-22 10:46:03 +00:00
parent c06580ff2a
commit 96aa730951

View File

@ -34,8 +34,8 @@ withLedgerDo opts args cmdname cmd = do
tc <- getClockTime
let go = cmd opts args . filterAndCacheLedgerWithOpts opts args t rawtext . (\rl -> rl{filepath=f,filereadtime=tc})
case creating of
True -> return rawLedgerEmpty >>= go
False -> return f >>= runErrorT . parseLedgerFile t >>= either (hPutStrLn stderr) go
True -> go rawLedgerEmpty
False -> (runErrorT . parseLedgerFile t) f >>= either (hPutStrLn stderr) go
-- | Get a Ledger from the given string and options, or raise an error.
ledgerFromStringWithOpts :: [Opt] -> [String] -> LocalTime -> String -> IO Ledger