Skip to content

Commit 20cb732

Browse files
committed
Inline Data.Aeson.Parser.Time
1 parent 872eb36 commit 20cb732

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Data/Aeson/Parser/Time.hs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,26 +30,31 @@ run p t = case A.parseOnly (p <* A.endOfInput) t of
3030
-- | Parse a date of the form @[+,-]YYYY-MM-DD@.
3131
day :: Parser Day
3232
day = T.day
33+
{-# INLINE day #-}
3334

3435
-- | Parse a time of the form @HH:MM[:SS[.SSS]]@.
3536
timeOfDay :: Parser Local.TimeOfDay
3637
timeOfDay = T.timeOfDay
38+
{-# INLINE timeOfDay #-}
3739

3840
-- | Parse a time zone, and return 'Nothing' if the offset from UTC is
3941
-- zero. (This makes some speedups possible.)
4042
timeZone :: Parser (Maybe Local.TimeZone)
4143
timeZone = T.timeZone
44+
{-# INLINE timeZone #-}
4245

4346
-- | Parse a date and time, of the form @YYYY-MM-DD HH:MM[:SS[.SSS]]@.
4447
-- The space may be replaced with a @T@. The number of seconds is optional
4548
-- and may be followed by a fractional component.
4649
localTime :: Parser Local.LocalTime
4750
localTime = T.localTime
51+
{-# INLINE localTime #-}
4852

4953
-- | Behaves as 'zonedTime', but converts any time zone offset into a
5054
-- UTC time.
5155
utcTime :: Parser UTCTime
5256
utcTime = T.utcTime
57+
{-# INLINE utcTime #-}
5358

5459
-- | Parse a date with time zone info. Acceptable formats:
5560
--
@@ -64,3 +69,4 @@ utcTime = T.utcTime
6469
-- (also optional) are minutes.
6570
zonedTime :: Parser Local.ZonedTime
6671
zonedTime = T.zonedTime
72+
{-# INLINE zonedTime #-}

0 commit comments

Comments
 (0)