-- |This module provides functions to parse and format RFC 1123 date
-- and time strings (<http://tools.ietf.org/html/rfc1123#page-55>).
--
--- The format is basically same as RFC 822, but the syntax for @date@
--- is changed from:
+-- The format is basically the same as RFC 822, but the syntax for
+-- @date@ is changed from:
--
-- > year ::= 2DIGIT
--
-- > year ::= 4DIGIT
module Data.Time.Format.RFC1123
( RFC1123
+ , rfc1123
, rfc1123DateAndTime
)
where
import Data.Attoparsec.Char8
import Data.Convertible.Base
import Data.Monoid.Unicode
+import Data.Proxy
import Data.Tagged
import Data.Time
import Data.Time.Calendar.WeekDate
-- Tagged "Sun, 06 Nov 1994 08:49:37 GMT"
data RFC1123
+-- |The proxy for conversions between RFC 1123 date and time strings
+-- and 'ZonedTime'.
+rfc1123 ∷ Proxy RFC1123
+{-# INLINE CONLIKE rfc1123 #-}
+rfc1123 = Proxy
+
instance ConvertSuccess ZonedTime (Tagged RFC1123 Ascii) where
{-# INLINE convertSuccess #-}
convertSuccess = (A.fromAsciiBuilder <$>) ∘ cs