]> gitweb @ CieloNegro.org - Lucu.git/blobdiff - Network/HTTP/Lucu/RFC1123DateTime.hs
Doc fix, optimization, and more.
[Lucu.git] / Network / HTTP / Lucu / RFC1123DateTime.hs
index 580691b7f4741a4370584f158f288af0e1adbeda..e9300a5d3def1fe31fe564f336f231fbe25499ca 100644 (file)
@@ -19,7 +19,8 @@ month =  ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct",
 week :: [String]
 week =  ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]
 
--- |Format a @CalendarTime@ to RFC 1123 Date and Time string.
+-- |Format a 'System.Time.CalendarTime' to RFC 1123 Date and Time
+-- string.
 formatRFC1123DateTime :: CalendarTime -> String
 formatRFC1123DateTime time
     = time `seq`
@@ -37,12 +38,12 @@ formatRFC1123DateTime time
       fmtDec 2 (ctMin    time)
       ++ ":"  ++
       fmtDec 2 (ctSec    time)
-      ++ ":"  ++
+      ++ " "  ++
       id       (ctTZName time)
       
 
--- |Format a @ClockTime@ to HTTP Date and Time. Time zone will be
--- always UTC but prints as GMT.
+-- |Format a 'System.Time.ClockTime' to HTTP Date and Time. Time zone
+-- will be always UTC but prints as GMT.
 formatHTTPDateTime :: ClockTime -> String
 formatHTTPDateTime time
     = time `seq`
@@ -65,8 +66,8 @@ formatHTTPDateTime time
 parseHTTPDateTime :: String -> Maybe ClockTime
 parseHTTPDateTime src
     = case parseStr httpDateTime src of
-        (Success ct, _) -> Just ct
-        _               -> Nothing
+        (# Success ct, _ #) -> Just ct
+        (# _         , _ #) -> Nothing
 
 
 httpDateTime :: Parser ClockTime