timerep 1.0.4 → 2.1.0.0
raw patch · 8 files changed
Files
- CHANGES.md +12/−0
- Data/Time/RFC2822.hs +39/−75
- Data/Time/RFC3339.hs +37/−54
- Data/Time/RFC822.hs +54/−0
- Data/Time/Util.hs +17/−0
- README.md +22/−0
- test/Main.hs +124/−0
- timerep.cabal +53/−28
+ CHANGES.md view
@@ -0,0 +1,12 @@+Change log+==========++#### 2.0.0.2+- Added non-zero day padding for RFC822++#### 2.0.0.1+- Compatibility with monoid-subclasses >= 0.4.1+- Renamed github repository to match package name++#### 2.0.0+- Added initial support for RFC822
Data/Time/RFC2822.hs view
@@ -1,5 +1,7 @@-{-# LANGUAGE CPP, TypeSynonymInstances, FlexibleInstances #-}--- | +{-# LANGUAGE FlexibleInstances #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE TypeSynonymInstances #-}+-- | -- Module : Data.Time.RFC2822 -- Copyright : (c) 2011 Hugo Daniel Gomes --@@ -8,15 +10,15 @@ -- Stability : experimental -- Portability : GHC ----- Support for reading and displaying time in the format specified by +-- Support for reading and displaying time in the format specified by -- the RFC2822 <http://www.ietf.org/rfc/rfc2822.txt> section 3.3 -- -- Example of usage:--- >+-- -- > import Data.Time.LocalTime -- >--- > showTime :: IO String--- > showTime = getZonedTime >>= return . showRFC2822+-- > showTime :: IO Text+-- > showTime = getZonedTime >>= return . formatTimeRFC2822 -- > -- > example1 = "Fri, 21 Nov 1997 09:55:06 -0600" -- > example2 = "Tue, 15 Nov 1994 12:45:26 GMT"@@ -28,87 +30,49 @@ -- > example8 = "24 Nov 1997 14:22:01 -0800" -- > examples = [example1,example2,example3,example4,example5,example6,example7,example8] -- >--- > readAll = map readRFC2822 examples+-- > readAll = map parseTimeRFC2822 examples module Data.Time.RFC2822 ( -- * Basic type class -- $basic- RFC2822(showRFC2822, readRFC2822)+ formatTimeRFC2822, parseTimeRFC2822 ) where -#if __GLASGOW_HASKELL__ < 710-import System.Locale-#endif+import Control.Applicative -import Data.Time.Format-import Data.Time.LocalTime-import Data.Time.Calendar-import Data.Maybe -import qualified Data.Attoparsec.Text as A-import Data.Attoparsec.Text import qualified Data.Attoparsec.Combinator as AC+import Data.Attoparsec.Text+import qualified Data.Attoparsec.Text as A+import Data.Maybe+import Data.Monoid ((<>))+import Data.Monoid.Textual hiding (foldr, map)+import Data.String (fromString)+import Data.Text (Text)+import Data.Time.Calendar+import Data.Time.Format (defaultTimeLocale, formatTime, parseTimeM)+import Data.Time.LocalTime+import Data.Time.Util -test1 = "Fri, 21 Nov 1997 09:55:06 -0600"-test2 = "Tue, 15 Nov 1994 12:45:26 GMT"-test3 = "Tue, 1 Jul 2003 10:52:37 +0200"-test4 = "Thu, 13 Feb 1969 23:32:54 -0330"-test5 = "Mon, 24 Nov 1997 14:22:01 -0800"-test6 = "Thu, 13\n Feb\n 1969\n 23:32\n -0330"-test7 = "Thu, 13\n Feb\n 1969\n 23:32\n -0330 (Newfoundland Time)" -- Fails-test8 = "24 Nov 1997 14:22:01 -0800"-test9 = "15 Nov 1994 12:45:26 GMT"-test10 = "Mon,24 Nov 1997 14:22:01 -0800"-test11 = "Thu,\t13\n Feb\n 1969\n 23:32\n -0330 (Newfoundland Time)" -- Fails-test12 = "Thu, 13 Feb 1969 23:32 -0330 (Newfoundland Time)" -- Fails-tests :: [String]-tests = [test1, test2, test3, test4, test5, test6, test7, test8, test9, test10- , test11, test12]-testParse = length (catMaybes (map readRFC2822 tests)) == length tests --- ------------------------------------------------------------------------------- The RFC2822 class definition---- | This class is here to allow future support for other data types --- like Data.Text or Data.ByteString if that becomes necessary-class RFC2822 a where- showRFC2822 :: ZonedTime -> a- readRFC2822 :: a -> Maybe ZonedTime- formatRFC2822 :: [a]---- | For now there is only an instance for the String data type-instance RFC2822 String where- showRFC2822 zt@(ZonedTime lt z) = - formatTime defaultTimeLocale "%a, %e %b %Y %T" zt ++ printZone- where- timeZoneStr = timeZoneOffsetString z- printZone = if timeZoneStr == timeZoneOffsetString utc+formatTimeRFC2822 :: (TextualMonoid t) => ZonedTime -> t+formatTimeRFC2822 zt@(ZonedTime lt z) = fromString (formatTime defaultTimeLocale "%a, %e %b %Y %T" zt) <> fromString printZone+ where timeZoneStr = timeZoneOffsetString z+ printZone = if timeZoneStr == timeZoneOffsetString utc then " GMT" else " " ++ timeZoneStr - formatRFC2822 = [ "%a, %e %b %Y %T GMT"- , "%a, %e %b %Y %T %z"- , "%e %b %Y %T GMT"- , "%e %b %Y %T %z"- -- Support for hours:minutes- , "%a, %e %b %Y %R GMT"- , "%a, %e %b %Y %R %z"- , "%e %b %Y %R GMT"- , "%e %b %Y %R %z"- ]-- readRFC2822 t = foldr (tryP t') Nothing $ map p formatRFC2822- where - p :: String -> String -> Maybe ZonedTime- p f s = parseTime defaultTimeLocale f s-- tryP :: String -> (String -> Maybe a) -> Maybe a -> Maybe a- tryP s f acc | isJust acc = acc- | otherwise = f s+formatsRFC2822 :: [Text]+formatsRFC2822 = do+ day <- ["%a, ", ""]+ time <- ["%T", "%R"] -- Support for hours:minutes+ zone <- ["GMT", "%z"]+ return $ day <> "%e %b %Y " <> time <> " " <> zone - -- t' is a trimmed t (currently only \n is trimmed)- -- TODO: trim other white space characters - t' :: String- t' = lines t >>= ("" ++)+parseTimeRFC2822 :: (TextualMonoid t) => t -> Maybe ZonedTime+parseTimeRFC2822 t = foldr (<|>) Nothing $ map parse formatsRFC2822+ where parse :: (TextualMonoid t) => t -> Maybe ZonedTime+ parse format = parseTimeM True defaultTimeLocale (toString' format) t' -showTime :: IO String-showTime = getZonedTime >>= return . showRFC2822+ -- t' is a trimmed t (currently only \n is trimmed)+ t' :: String+ t' = lines (toString' t) >>= ("" ++)
Data/Time/RFC3339.hs view
@@ -1,5 +1,7 @@-{-# LANGUAGE CPP, TypeSynonymInstances, FlexibleInstances #-}--- | +{-# LANGUAGE FlexibleInstances #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE TypeSynonymInstances #-}+-- | -- Module : Data.Time.RFC3339 -- Copyright : (c) 2011 Hugo Daniel Gomes --@@ -8,15 +10,15 @@ -- Stability : experimental -- Portability : GHC ----- Support for reading and displaying time in the format specified by +-- Support for reading and displaying time in the format specified by -- the RFC3339 <http://www.ietf.org/rfc/rfc3339.txt> -- -- Example of usage:--- >+-- -- > import Data.Time.LocalTime -- >--- > showTime :: IO String--- > showTime = getZonedTime >>= return . showRFC3339+-- > showTime :: IO Text+-- > showTime = formatTimeRFC3339 <$> getZonedTime -- > -- > example1 = "1985-04-12T23:20:50.52Z" -- > example2 = "1996-12-19T16:39:57-08:00"@@ -25,64 +27,45 @@ -- > example5 = "1937-01-01T12:00:27.87+00:20" -- > examples = [example1,example2,example3,example4,example5] -- >--- > readAll = map readRFC3339 examples+-- > readAll = map parseTimeRFC3339 examples module Data.Time.RFC3339 ( -- * Basic type class -- $basic- RFC3339(showRFC3339, readRFC3339)+ formatTimeRFC3339, formatDateRFC3339, parseTimeRFC3339, parseDateRFC3339 ) where -#if __GLASGOW_HASKELL__ < 710-import System.Locale-#endif+import Control.Applicative -import Data.Time.Format-import Data.Time.LocalTime-import Data.Time.Calendar-import Data.Maybe +import Data.Maybe+import Data.Monoid ((<>))+import Data.Monoid.Textual hiding (foldr, map)+import Data.String (fromString)+import Data.Text (Text)+import Data.Time.Calendar+import Data.Time.Format+import Data.Time.LocalTime+import Data.Time.Util -test1 = "1985-04-12T23:20:50.52Z"-test2 = "1996-12-19T16:39:57-08:00"-test3 = "1990-12-31T23:59:60Z"-test4 = "1990-12-31T15:59:60-08:00"-test5 = "1937-01-01T12:00:27.87+00:20"-tests :: [String]-tests = [test1, test2, test3, test4, test5]-testParse = length (catMaybes (map readRFC3339 tests)) == length tests --- ------------------------------------------------------------------------------- The RFC3339 class definition+formatTimeRFC3339 :: (TextualMonoid t) => ZonedTime -> t+formatTimeRFC3339 zt@(ZonedTime lt z) = fromString (formatTime defaultTimeLocale "%FT%T" zt) <> fromString printZone+ where timeZoneStr = timeZoneOffsetString z+ printZone = if timeZoneStr == timeZoneOffsetString utc+ then "Z"+ else take 3 timeZoneStr <> ":" <> drop 3 timeZoneStr --- | This class is here to allow future support for other data types --- like Data.Text or Data.ByteString if that becomes necessary-class RFC3339 a where- showRFC3339 :: ZonedTime -> a- readRFC3339 :: a -> Maybe ZonedTime- formatRFC3339 :: [a]+formatDateRFC3339 :: (TextualMonoid t, FormatTime time) => time -> t+formatDateRFC3339 day = fromString (formatTime defaultTimeLocale "%F" day) --- | For now there is only an instance for the String data type-instance RFC3339 String where- showRFC3339 zt@(ZonedTime lt z) = - formatTime defaultTimeLocale "%FT%T" zt ++ printZone- where- timeZoneStr = timeZoneOffsetString z- printZone = if timeZoneStr == timeZoneOffsetString utc- then "Z"- else take 3 timeZoneStr ++ ":" ++ drop 3 timeZoneStr- formatRFC3339 = [ "%FT%TZ"- , "%FT%T%z"- , "%FT%T%Q%z"- , "%FT%T%QZ"- ]- readRFC3339 t = foldr (tryP t) Nothing $ map p formatRFC3339- where - p :: String -> String -> Maybe ZonedTime- p f s = parseTime defaultTimeLocale f s+formatsRFC3339 :: [Text]+formatsRFC3339 = do+ fraction <- ["%Q", ""]+ zone <- ["Z", "%z"]+ return $ "%FT%T" <> fraction <> zone - tryP :: String -> (String -> Maybe a) -> Maybe a -> Maybe a- tryP s f acc | isJust acc = acc- | otherwise = f s+parseTimeRFC3339 :: (TextualMonoid t) => t -> Maybe ZonedTime+parseTimeRFC3339 = parseTimeUsing formatsRFC3339 -showTime :: IO String-showTime = getZonedTime >>= return . showRFC3339+parseDateRFC3339 :: (TextualMonoid t) => t -> Maybe Day+parseDateRFC3339 = parseTimeUsing ["%F" :: Text]
+ Data/Time/RFC822.hs view
@@ -0,0 +1,54 @@+{-# LANGUAGE FlexibleInstances #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE TypeSynonymInstances #-}+-- | Support for reading and displaying time in the format specified by+-- the RFC822 <http://www.ietf.org/rfc/rfc0822.txt> section 5.+--+-- Example of usage:+--+-- > import Data.Time.LocalTime+-- >+-- > showTime :: IO Text+-- > showTime = formatTimeRFC822 <$> getZonedTime+-- >+-- > example1 = "Wed, 02 Oct 2002 13:00:00 GMT"+-- > example2 = "Wed, 02 Oct 2002 13:00:00 +0100"+-- > example3 = "Wed, 02 Oct 2002 13:00 +0100"+-- > example4 = "02 Oct 2002 13:00 +0100"+-- > example5 = "02 Oct 02 13:00 +0100"+-- > examples = [example1, example2, example3, example4, example5]+-- >+-- > readAll = map parseTimeRFC822 examples++module Data.Time.RFC822 (+ -- * Basic type class+ -- $basic+ formatTimeRFC822, parseTimeRFC822+) where++import Control.Applicative++import Data.Maybe+import Data.Monoid ((<>))+import Data.Monoid.Textual hiding (foldr, map)+import Data.String (fromString)+import Data.Text (Text)+import Data.Time.Calendar+import Data.Time.Format+import Data.Time.LocalTime+import Data.Time.Util+++formatTimeRFC822 :: (TextualMonoid t) => ZonedTime -> t+formatTimeRFC822 zonedTime = fromString $ formatTime defaultTimeLocale "%a, %d %b %Y %X %z" zonedTime++formatsRFC822 :: [Text]+formatsRFC822 = do+ day <- ["%a, ", ""]+ year <- ["%y", "%Y"]+ time <- ["%X", "%H:%M"]+ zone <- ["%z", "%Z"]+ return $ day <> "%e %b " <> year <> " " <> time <> " " <> zone++parseTimeRFC822 :: (TextualMonoid t) => t -> Maybe ZonedTime+parseTimeRFC822 = parseTimeUsing formatsRFC822
+ Data/Time/Util.hs view
@@ -0,0 +1,17 @@+module Data.Time.Util where++import Control.Applicative++import Data.Function+import Data.Monoid (mempty)+import Data.Monoid.Textual hiding (foldr, map)+import Data.Time+import Data.Time.Format (ParseTime, defaultTimeLocale)+++toString' :: (TextualMonoid t) => t -> String+toString' = toString (maybe "?" (:[]) . characterPrefix)++parseTimeUsing :: (TextualMonoid t, TextualMonoid t', ParseTime time) => [t] -> t' -> Maybe time+parseTimeUsing formats t = foldr (<|>) Nothing $ map parse formats+ where parse format = parseTimeM True defaultTimeLocale (toString' format) (toString' t)
+ README.md view
@@ -0,0 +1,22 @@+timerep+=======++This started out as a simple project to parse and display time according to+[RFC 3339](http://tools.ietf.org/html/rfc3339), but with time gained ability+to convert to and from other RFCs as well.++You will find a change log in `CHANGES.md`.+++### Todos++- Get rid of the `formatTime` function, and use a more decent pretty+ printing lib.+- Do some proper parsing (it parses nicely, but this was just a quick hack+ that my mind produced while being stressed to finish this).+++### License++This project is licensed under a 3-clause BSD license as specified in the+`LICENSE` file.
+ test/Main.hs view
@@ -0,0 +1,124 @@+import Data.Fixed (E12, Fixed (..))+import Data.Maybe+import Data.Text+import Data.Time.Calendar+import Data.Time.LocalTime+import Data.Time.RFC2822+import Data.Time.RFC3339+import Data.Time.RFC822++import Test.QuickCheck hiding (Fixed)+import Test.Tasty+import Test.Tasty.HUnit+import Test.Tasty.QuickCheck+++instance Arbitrary TimeOfDay where+ arbitrary = TimeOfDay <$> choose (0, 23) <*> choose (0, 59) <*> pure 0++instance Arbitrary Day where+ arbitrary = ModifiedJulianDay <$> arbitrary++instance Arbitrary LocalTime where+ arbitrary = LocalTime <$> arbitrary <*> arbitrary++instance Arbitrary TimeZone where+ arbitrary = TimeZone <$> arbitrary <*> arbitrary <*> elements timeZones+ where timeZones = [ "ACDT", "ACST", "ACT", "ACT", "ADT", "AEDT"+ , "AEST", "AFT", "AKDT", "AKST", "AMST", "AMST"+ , "AMT", "AMT", "ART", "AST", "AST", "AWDT", "AWST"+ , "AZOST", "AZT", "BDT", "BIOT", "BIT", "BOT"+ , "BRST", "BRT", "BST", "BST", "BTT", "CAT", "CCT"+ , "CDT", "CDT", "CEDT", "CEST", "CET", "CHADT"+ , "CHAST", "CHOT", "ChST", "CHUT", "CIST", "CIT"+ , "CKT", "CLST", "CLT", "COST", "COT", "CST", "CST"+ , "CST", "CST", "CST", "CT", "CVT", "CWST", "CXT"+ , "DAVT", "DDUT", "DFT", "EASST", "EAST", "EAT"+ , "ECT", "ECT", "EDT", "EEDT", "EEST", "EET"+ , "EGST", "EGT", "EIT", "EST", "EST", "FET", "FJT"+ , "FKST", "FKST", "FKT", "FNT", "GALT", "GAMT"+ , "GET", "GFT", "GILT", "GIT", "GMT", "GST", "GST"+ , "GYT", "HADT", "HAEC", "HAST", "HKT", "HMT"+ , "HOVT", "HST", "ICT", "IDT", "IOT", "IRDT"+ , "IRKT", "IRST", "IST", "IST", "IST", "JST", "KGT"+ , "KOST", "KRAT", "KST", "LHST", "LHST", "LINT"+ , "MAGT", "MART", "MAWT", "MDT", "MET", "MEST"+ , "MHT", "MIST", "MIT", "MMT", "MSK", "MST", "MST"+ , "MST", "MUT", "MVT", "MYT", "NCT", "NDT", "NFT"+ , "NPT", "NST", "NT", "NUT", "NZDT", "NZST", "OMST"+ , "ORAT", "PDT", "PET", "PETT", "PGT", "PHOT"+ , "PKT", "PMDT", "PMST", "PONT", "PST", "PST"+ , "PYST", "PYT", "RET", "ROTT", "SAKT", "SAMT"+ , "SAST", "SBT", "SCT", "SGT", "SLST", "SRET"+ , "SRT", "SST", "SST", "SYOT", "TAHT", "THA", "TFT"+ , "TJT", "TKT", "TLT", "TMT", "TOT", "TVT", "UCT"+ , "ULAT", "USZ1", "UTC", "UYST", "UYT", "UZT"+ , "VET", "VLAT", "VOLT", "VOST", "VUT", "WAKT"+ , "WAST", "WAT", "WEDT", "WEST", "WET", "WIT"+ , "WST", "YAKT", "YEKT", "Z" ]++instance Arbitrary ZonedTime where+ arbitrary = ZonedTime <$> arbitrary <*> arbitrary+++main :: IO ()+main = defaultMain $ testGroup "Tests" [unitTests, properties]+++unitTests :: TestTree+unitTests = testGroup "Unit tests" [casesRFC3339 , casesRFC2822, casesRFC822]++casesRFC3339, casesRFC2822 :: TestTree+casesRFC3339 = testCase "RFC 3339 cases" $ do+ isJust (parseTimeRFC3339 "1985-04-12T23:20:50.52Z") @?= True+ isJust (parseTimeRFC3339 "1996-12-19T16:39:57-08:00") @?= True+ isJust (parseTimeRFC3339 "1990-12-31T23:59:60Z") @?= True+ isJust (parseTimeRFC3339 "1990-12-31T15:59:60-08:00") @?= True+ isJust (parseTimeRFC3339 "1937-01-01T12:00:27.87+00:20") @?= True+ isJust (parseDateRFC3339 "1985-04-12") @?= True+ isJust (parseDateRFC3339 "1996-12-19") @?= True+ isJust (parseDateRFC3339 "1990-12-31") @?= True+ isJust (parseDateRFC3339 "1937-01-01") @?= True+casesRFC2822 = testCase "RFC 2822 cases" $ do+ isJust (parseTimeRFC2822 "Fri, 21 Nov 1997 09:55:06 -0600") @?= True+ isJust (parseTimeRFC2822 "Tue, 15 Nov 1994 12:45:26 GMT") @?= True+ isJust (parseTimeRFC2822 "Tue, 1 Jul 2003 10:52:37 +0200") @?= True+ isJust (parseTimeRFC2822 "Thu, 13 Feb 1969 23:32:54 -0330") @?= True+ isJust (parseTimeRFC2822 "Mon, 24 Nov 1997 14:22:01 -0800") @?= True+ isJust (parseTimeRFC2822 "Thu, 13\n Feb\n 1969\n 23:32\n -0330") @?= True+ isJust (parseTimeRFC2822 "Thu, 13\n Feb\n 1969\n 23:32\n -0330 (Newfoundland Time)") @?= False+ isJust (parseTimeRFC2822 "24 Nov 1997 14:22:01 -0800") @?= True+ isJust (parseTimeRFC2822 "15 Nov 1994 12:45:26 GMT") @?= True+ isJust (parseTimeRFC2822 "Mon,24 Nov 1997 14:22:01 -0800") @?= False+ isJust (parseTimeRFC2822 "Thu,\t13\n Feb\n 1969\n 23:32\n -0330 (Newfoundland Time)") @?= False+ isJust (parseTimeRFC2822 "Thu, 13 Feb 1969 23:32 -0330 (Newfoundland Time)") @?= False+casesRFC822 = testCase "RFC 822 cases" $ do+ isJust (parseTimeRFC822 "Wed, 02 Oct 2002 13:00:00 GMT") @?= True+ isJust (parseTimeRFC822 "Wed, 02 Oct 2002 13:00:00 +0100") @?= True+ isJust (parseTimeRFC822 "Wed, 02 Oct 2002 13:00 +0100") @?= True+ isJust (parseTimeRFC822 "Wed, 2 Oct 2002 13:00 +0100") @?= True+ isJust (parseTimeRFC822 "02 Oct 2002 13:00 +0100") @?= True+ isJust (parseTimeRFC822 "02 Oct 02 13:00 +0100") @?= True+ isJust (parseTimeRFC822 "2 Oct 02 13:00 +0100") @?= True+++properties :: TestTree+properties = testGroup "Properties"+ [ inverseTimeRFC3339Property+ , inverseDateRFC3339Property+ , inverseRFC2822Property+ , inverseRFC822Property+ ]++inverseTimeRFC3339Property, inverseDateRFC3339Property, inverseRFC2822Property, inverseRFC822Property :: TestTree+inverseTimeRFC3339Property = testProperty "parse . format = id (RFC3339 date-time)" $ \zonedTime ->+ (fmap zonedTimeToUTC . parseTimeRFC3339 . asText . formatTimeRFC3339) zonedTime == Just (zonedTimeToUTC zonedTime)+inverseDateRFC3339Property = testProperty "parse . format = id (RFC3339 date)" $ \day ->+ (parseDateRFC3339 . asText . formatDateRFC3339) day == Just day+inverseRFC2822Property = testProperty "parse . format = id (RFC2822)" $ \zonedTime ->+ (fmap zonedTimeToUTC . parseTimeRFC2822 . asText . formatTimeRFC2822) zonedTime == Just (zonedTimeToUTC zonedTime)+inverseRFC822Property = testProperty "parse . format = id (RFC822)" $ \zonedTime ->+ (fmap zonedTimeToUTC . parseTimeRFC822 . asText . formatTimeRFC822) zonedTime == Just (zonedTimeToUTC zonedTime)++asText :: Text -> Text+asText = id
timerep.cabal view
@@ -1,41 +1,66 @@-Name: timerep-Version: 1.0.4-Category: Web, Time-Synopsis: Parse and display time according to some RFCs (RFC3339, RFC2822)-Description: - .+name: timerep+version: 2.1.0.0+category: Web, Time, Parser, Text+synopsis: Parse and display time according to some RFCs (RFC3339, RFC2822, RFC822)+description: Parse and display time according to some RFC's.- Supported: - RFC3339 <http://www.ietf.org/rfc/rfc3339.txt>- RFC2822 <http://www.ietf.org/rfc/rfc2822.txt> .- This package defines a type class to parse and read time representations - specified in some RFC's.- Right now there is only support for reading and showing String+ Supported: .- Special thanks to Koral for all the suggestions and help in solving some bugs+ * RFC822 <http://www.ietf.org/rfc/rfc0822.txt> .-Build-type: Simple-Maintainer: Hugo Daniel Gomes <mr.hugo.gomes@gmail.com>-Author: Hugo Daniel Gomes <mr.hugo.gomes@gmail.com>-Copyright: Hugo Daniel Gomes-Cabal-version: >= 1.6-License: BSD3-License-file: LICENSE-source-repository head - type: git - location: git://github.com/HugoDaniel/RFC3339.git+ * RFC2822 <http://www.ietf.org/rfc/rfc2822.txt>+ .+ * RFC3339 <http://www.ietf.org/rfc/rfc3339.txt>+ .+ Special thanks to Koral for all the suggestions and help in solving some bugs.+build-type: Simple+maintainer: Hugo Daniel Gomes <mr.hugo.gomes@gmail.com>+author: Hugo Daniel Gomes <mr.hugo.gomes@gmail.com>+copyright: (c) 2010-2015 Hugo Daniel Gomes+cabal-version: >= 1.10+homepage: https://github.com/HugoDaniel/timerep+bug-reports: https://github.com/HugoDaniel/timerep/issues+license: BSD3+license-file: LICENSE+extra-source-files:+ README.md,+ CHANGES.md +source-repository head+ type: git+ location: git://github.com/HugoDaniel/timerep.git+ library+ default-language: Haskell2010 build-depends:- base < 5, - time >= 1.2, - attoparsec,- old-locale+ base < 5,+ monoid-subclasses >= 0.4.1,+ text,+ time >= 1.9,+ attoparsec exposed-modules: Data.Time.RFC3339 Data.Time.RFC2822+ Data.Time.RFC822 - extensions: TypeSynonymInstances FlexibleInstances+ other-modules:+ Data.Time.Util + ghc-options: -Wall++test-suite Tests+ default-language: Haskell2010+ type: exitcode-stdio-1.0+ hs-source-dirs: test+ main-is: Main.hs+ build-depends:+ base < 5,+ QuickCheck,+ tasty,+ tasty-hunit,+ tasty-quickcheck,+ text,+ time >= 1.9,+ timerep >= 2