From 82afb594c5b4254385435491700befcbea185a5d Mon Sep 17 00:00:00 2001 From: PHO Date: Fri, 26 Aug 2011 19:24:32 +0900 Subject: [PATCH] Changed some module's name --- Data/Time/Asctime.hs | 5 +---- Data/Time/Asctime/{Parsec.hs => Internal.hs} | 4 +--- Data/Time/HTTP.hs | 5 +---- Data/Time/HTTP/Common.hs | 2 -- Data/Time/HTTP/{Parsec.hs => Internal.hs} | 10 ++++------ Data/Time/RFC1123.hs | 5 +---- Data/Time/RFC1123/{Parsec.hs => Internal.hs} | 6 ++---- Data/Time/RFC733.hs | 5 +---- Data/Time/RFC733/{Parsec.hs => Internal.hs} | 4 +--- Data/Time/RFC822.hs | 8 ++------ Data/Time/RFC822/{Parsec.hs => Internal.hs} | 6 +----- time-http.cabal | 20 +++++++++++--------- 12 files changed, 26 insertions(+), 54 deletions(-) rename Data/Time/Asctime/{Parsec.hs => Internal.hs} (94%) rename Data/Time/HTTP/{Parsec.hs => Internal.hs} (76%) rename Data/Time/RFC1123/{Parsec.hs => Internal.hs} (93%) rename Data/Time/RFC733/{Parsec.hs => Internal.hs} (98%) rename Data/Time/RFC822/{Parsec.hs => Internal.hs} (97%) diff --git a/Data/Time/Asctime.hs b/Data/Time/Asctime.hs index 2eef569..3ea13d8 100644 --- a/Data/Time/Asctime.hs +++ b/Data/Time/Asctime.hs @@ -23,13 +23,10 @@ module Data.Time.Asctime , parse ) where - -import qualified Text.Parsec as P - import Data.Time import Data.Time.Calendar.WeekDate import Data.Time.HTTP.Common -import Data.Time.Asctime.Parsec +import Data.Time.Asctime.Internal -- |Format a 'LocalTime' in the ANSI C's asctime() way. format :: LocalTime -> String diff --git a/Data/Time/Asctime/Parsec.hs b/Data/Time/Asctime/Internal.hs similarity index 94% rename from Data/Time/Asctime/Parsec.hs rename to Data/Time/Asctime/Internal.hs index 201f347..85707c6 100644 --- a/Data/Time/Asctime/Parsec.hs +++ b/Data/Time/Asctime/Internal.hs @@ -1,15 +1,13 @@ {-# LANGUAGE FlexibleContexts #-} -module Data.Time.Asctime.Parsec +module Data.Time.Asctime.Internal ( asctime ) where - import Control.Monad import Data.Fixed import Data.Time import Data.Time.Calendar.WeekDate import Data.Time.HTTP.Common -import Text.Parsec -- |This is a parsec parser for ANSI C's asctime() format. asctime :: Stream s m Char => ParsecT s u m LocalTime diff --git a/Data/Time/HTTP.hs b/Data/Time/HTTP.hs index 9f62806..4352e8b 100644 --- a/Data/Time/HTTP.hs +++ b/Data/Time/HTTP.hs @@ -41,12 +41,9 @@ module Data.Time.HTTP , parse ) where - import qualified Data.Time.RFC1123 as RFC1123 -import qualified Text.Parsec as P - import Data.Time -import Data.Time.HTTP.Parsec +import Data.Time.HTTP.Internal -- |Format an 'UTCTime' in RFC 1123 date and time. format :: UTCTime -> String diff --git a/Data/Time/HTTP/Common.hs b/Data/Time/HTTP/Common.hs index a84dda7..e0a899e 100644 --- a/Data/Time/HTTP/Common.hs +++ b/Data/Time/HTTP/Common.hs @@ -26,12 +26,10 @@ module Data.Time.HTTP.Common , assertTimeOfDayIsGood ) where - import Control.Monad import Data.Fixed import Data.Time import Data.Time.Calendar.WeekDate -import Text.Parsec shortWeekDayName :: Int -> String shortWeekDayName 1 = "Mon" diff --git a/Data/Time/HTTP/Parsec.hs b/Data/Time/HTTP/Internal.hs similarity index 76% rename from Data/Time/HTTP/Parsec.hs rename to Data/Time/HTTP/Internal.hs index 6ddca7e..06a0ad2 100644 --- a/Data/Time/HTTP/Parsec.hs +++ b/Data/Time/HTTP/Internal.hs @@ -1,15 +1,13 @@ {-# LANGUAGE FlexibleContexts #-} -module Data.Time.HTTP.Parsec +module Data.Time.HTTP.Internal ( rfc2616DateAndTime ) where - import Control.Monad import Data.Time -import Data.Time.RFC1123.Parsec -import Data.Time.RFC733.Parsec -import Data.Time.Asctime.Parsec -import Text.Parsec +import Data.Time.RFC1123.Internal +import Data.Time.RFC733.Internal +import Data.Time.Asctime.Internal -- |This is a parsec parser for date and time formats allowed in -- HTTP\/1.1 (RFC 2616). diff --git a/Data/Time/RFC1123.hs b/Data/Time/RFC1123.hs index 43594c5..93aeb7e 100644 --- a/Data/Time/RFC1123.hs +++ b/Data/Time/RFC1123.hs @@ -14,14 +14,11 @@ module Data.Time.RFC1123 , parse ) where - -import qualified Text.Parsec as P - import Data.Time import Data.Time.Calendar.WeekDate import Data.Time.HTTP.Common import Data.Time.RFC822 (showRFC822TimeZone) -import Data.Time.RFC1123.Parsec +import Data.Time.RFC1123.Internal -- |Format a 'ZonedTime' in RFC 1123. format :: ZonedTime -> String diff --git a/Data/Time/RFC1123/Parsec.hs b/Data/Time/RFC1123/Internal.hs similarity index 93% rename from Data/Time/RFC1123/Parsec.hs rename to Data/Time/RFC1123/Internal.hs index 08c989c..b7bb6c9 100644 --- a/Data/Time/RFC1123/Parsec.hs +++ b/Data/Time/RFC1123/Internal.hs @@ -1,16 +1,14 @@ {-# LANGUAGE FlexibleContexts #-} -module Data.Time.RFC1123.Parsec +module Data.Time.RFC1123.Internal ( rfc1123DateAndTime ) where - import Control.Monad import Data.Fixed import Data.Time import Data.Time.Calendar.WeekDate import Data.Time.HTTP.Common -import Data.Time.RFC822.Parsec -import Text.Parsec +import Data.Time.RFC822.Internal -- |This is a parsec parser for RFC 1123 date and time strings. rfc1123DateAndTime :: Stream s m Char => ParsecT s u m ZonedTime diff --git a/Data/Time/RFC733.hs b/Data/Time/RFC733.hs index 119d01d..9073cd7 100644 --- a/Data/Time/RFC733.hs +++ b/Data/Time/RFC733.hs @@ -42,13 +42,10 @@ module Data.Time.RFC733 , parse ) where - -import qualified Text.Parsec as P - import Data.Time import Data.Time.Calendar.WeekDate import Data.Time.HTTP.Common -import Data.Time.RFC733.Parsec +import Data.Time.RFC733.Internal -- |Format a 'ZonedTime' in RFC 733. format :: ZonedTime -> String diff --git a/Data/Time/RFC733/Parsec.hs b/Data/Time/RFC733/Internal.hs similarity index 98% rename from Data/Time/RFC733/Parsec.hs rename to Data/Time/RFC733/Internal.hs index f266193..5002655 100644 --- a/Data/Time/RFC733/Parsec.hs +++ b/Data/Time/RFC733/Internal.hs @@ -1,15 +1,13 @@ {-# LANGUAGE FlexibleContexts #-} -module Data.Time.RFC733.Parsec +module Data.Time.RFC733.Internal ( rfc733DateAndTime ) where - import Control.Monad import Data.Fixed import Data.Time import Data.Time.Calendar.WeekDate import Data.Time.HTTP.Common -import Text.Parsec -- |This is a parsec parser for RFC 733 date and time strings. rfc733DateAndTime :: Stream s m Char => ParsecT s u m ZonedTime diff --git a/Data/Time/RFC822.hs b/Data/Time/RFC822.hs index 4c8e333..5d4b862 100644 --- a/Data/Time/RFC822.hs +++ b/Data/Time/RFC822.hs @@ -1,5 +1,3 @@ -{-# OPTIONS_HADDOCK prune #-} - -- |This module provides functions to parse and format RFC 822 date -- and time formats. -- @@ -37,13 +35,10 @@ module Data.Time.RFC822 , showRFC822TimeZone ) where - -import qualified Text.Parsec as P - import Data.Time import Data.Time.Calendar.WeekDate import Data.Time.HTTP.Common -import Data.Time.RFC822.Parsec +import Data.Time.RFC822.Internal -- |Format a 'ZonedTime' in RFC 822. format :: ZonedTime -> String @@ -71,6 +66,7 @@ format zonedTime , showRFC822TimeZone timeZone ] +-- private showRFC822TimeZone :: TimeZone -> String showRFC822TimeZone tz | timeZoneMinutes tz == 0 = "GMT" diff --git a/Data/Time/RFC822/Parsec.hs b/Data/Time/RFC822/Internal.hs similarity index 97% rename from Data/Time/RFC822/Parsec.hs rename to Data/Time/RFC822/Internal.hs index 0ab2985..ed7549a 100644 --- a/Data/Time/RFC822/Parsec.hs +++ b/Data/Time/RFC822/Internal.hs @@ -1,20 +1,16 @@ {-# LANGUAGE FlexibleContexts #-} -{-# OPTIONS_HADDOCK prune #-} - -module Data.Time.RFC822.Parsec +module Data.Time.RFC822.Internal ( rfc822DateAndTime -- private , rfc822time ) where - import Control.Monad import Data.Fixed import Data.Time import Data.Time.Calendar.WeekDate import Data.Time.HTTP.Common -import Text.Parsec -- |This is a parsec parser for RFC 822 date and time strings. rfc822DateAndTime :: Stream s m Char => ParsecT s u m ZonedTime diff --git a/time-http.cabal b/time-http.cabal index f057d69..f22e117 100644 --- a/time-http.cabal +++ b/time-http.cabal @@ -1,5 +1,5 @@ Name: time-http -Version: 0.1.0.1 +Version: 0.2 Synopsis: Parse and format HTTP/1.1 Date and Time strings Description: This package provides functionalities to parse and format @@ -23,23 +23,25 @@ Source-Repository head Library Exposed-modules: Data.Time.RFC733 - Data.Time.RFC733.Parsec + Data.Time.RFC733.Internal Data.Time.RFC822 - Data.Time.RFC822.Parsec + Data.Time.RFC822.Internal Data.Time.RFC1123 - Data.Time.RFC1123.Parsec + Data.Time.RFC1123.Internal Data.Time.Asctime - Data.Time.Asctime.Parsec + Data.Time.Asctime.Internal Data.Time.HTTP - Data.Time.HTTP.Parsec + Data.Time.HTTP.Internal Other-modules: Data.Time.HTTP.Common Build-depends: - base == 4.3.*, - parsec == 3.1.*, - time == 1.2.* + ascii == 0.0.*, + attoparsec == 0.9.*, + base == 4.3.*, + base-unicode-symbols == 0.2.*, + time == 1.2.* Extensions: FlexibleContexts -- 2.40.0