mirror of
https://github.com/simonmichael/hledger.git
synced 2024-12-26 03:42:25 +03:00
Refactor getSeparator
This commit is contained in:
parent
92f680875f
commit
9011aaa5ba
@ -115,9 +115,7 @@ parseSeparator = specials . map toLower
|
||||
-- | Decide which separator to get.
|
||||
-- If the external separator is provided, take it. Otherwise, look at the rules. Finally, return ','.
|
||||
getSeparator :: CsvRules -> Char
|
||||
getSeparator rules = head $
|
||||
catMaybes [ getDirective "separator" rules >>= parseSeparator
|
||||
, Just ',']
|
||||
getSeparator rules = maybe ',' id (getDirective "separator" rules >>= parseSeparator)
|
||||
|
||||
-- | Read a Journal from the given CSV data (and filename, used for error
|
||||
-- messages), or return an error. Proceed as follows:
|
||||
|
Loading…
Reference in New Issue
Block a user