]> gitweb @ CieloNegro.org - Lucu.git/blobdiff - Network/HTTP/Lucu/Interaction.hs
use time-http 0.5
[Lucu.git] / Network / HTTP / Lucu / Interaction.hs
index 7c43f96c5e7a12bcf3145771a7ea6b4976fed17e..35c9f06493d45c4cb92f65d9271c82280100d8fe 100644 (file)
@@ -26,6 +26,7 @@ module Network.HTTP.Lucu.Interaction
     , mkInteractionQueue
 
     , getCurrentDate
+    , formatUTCTime
     )
     where
 import Blaze.ByteString.Builder (Builder)
@@ -35,8 +36,8 @@ import Data.Ascii (Ascii)
 import Data.ByteString (ByteString)
 import Data.Convertible.Base
 import Data.Monoid.Unicode
-import Data.Proxy
 import Data.Sequence (Seq)
+import Data.Tagged
 import Data.Time
 import Data.Time.Format.HTTP
 import Data.Typeable
@@ -47,6 +48,7 @@ import Network.HTTP.Lucu.Headers
 import Network.HTTP.Lucu.Preprocess
 import Network.HTTP.Lucu.Request
 import Network.HTTP.Lucu.Response
+import Network.HTTP.Lucu.Response.StatusCode
 import Network.HTTP.Lucu.Utils
 #if defined(HAVE_SSL)
 import OpenSSL.X509
@@ -247,4 +249,11 @@ mkInteractionQueue = newTVarIO (∅)
 
 getCurrentDate ∷ IO Ascii
 {-# INLINE getCurrentDate #-}
-getCurrentDate = flip proxy http ∘ cs <$> getCurrentTime
+getCurrentDate = formatUTCTime <$> getCurrentTime
+
+formatUTCTime ∷ UTCTime → Ascii
+{-# INLINE formatUTCTime #-}
+formatUTCTime = cs' ∘ Tagged
+    where
+      cs' ∷ Tagged HTTP UTCTime → Ascii
+      cs' = cs