mirror of
https://github.com/simonmichael/hledger.git
synced 2024-12-29 13:22:27 +03:00
cln: Remove some explicit Text packing.
This commit is contained in:
parent
2a51b6e9a4
commit
43b7e849c7
@ -967,18 +967,14 @@ reportingintervalp = choice'
|
||||
(toPermutation $ nth <* skipNonNewlineSpaces)
|
||||
|
||||
-- Parse any of several variants of a basic interval, eg "daily", "every day", "every N days".
|
||||
tryinterval :: String -> String -> (Int -> Interval) -> TextParser m Interval
|
||||
tryinterval :: Text -> Text -> (Int -> Interval) -> TextParser m Interval
|
||||
tryinterval singular compact intcons = intcons <$> choice'
|
||||
[ 1 <$ string' compact'
|
||||
[ 1 <$ string' compact
|
||||
, string' "every" *> skipNonNewlineSpaces *> choice
|
||||
[ 1 <$ string' singular'
|
||||
, decimal <* skipNonNewlineSpaces <* string' plural'
|
||||
[ 1 <$ string' singular
|
||||
, decimal <* skipNonNewlineSpaces <* string' (singular <> "s")
|
||||
]
|
||||
]
|
||||
where
|
||||
compact' = T.pack compact
|
||||
singular' = T.pack singular
|
||||
plural' = T.pack $ singular ++ "s"
|
||||
|
||||
periodexprdatespanp :: Day -> TextParser m DateSpan
|
||||
periodexprdatespanp rdate = choice $ map try [
|
||||
|
Loading…
Reference in New Issue
Block a user