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