]> gitweb @ CieloNegro.org - Lucu.git/blobdiff - Network/HTTP/Lucu/Interaction.hs
use time-http 0.5
[Lucu.git] / Network / HTTP / Lucu / Interaction.hs
index ec9207032ce845a0fb68e0bd963a8b08d3953fd1..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
@@ -248,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