From 43b7e849c74e79170b97d5ac86acf57657b3897c Mon Sep 17 00:00:00 2001 From: Stephen Morgan Date: Tue, 4 Jan 2022 12:02:07 +0100 Subject: [PATCH] cln: Remove some explicit Text packing. --- hledger-lib/Hledger/Data/Dates.hs | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/hledger-lib/Hledger/Data/Dates.hs b/hledger-lib/Hledger/Data/Dates.hs index f8da7c5a4..757fbc802 100644 --- a/hledger-lib/Hledger/Data/Dates.hs +++ b/hledger-lib/Hledger/Data/Dates.hs @@ -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 [