xsd 0.3.1 → 0.3.2
raw patch · 2 files changed
+11/−6 lines, 2 filesdep ~base
Dependency ranges changed: base
Files
- Text/XML/XSD/DateTime.hs +7/−2
- xsd.cabal +4/−4
Text/XML/XSD/DateTime.hs view
@@ -59,7 +59,7 @@ let (yy, mm, dd) = toGregorian d (sss1, sss2) = properFraction sss (hz, mz) = m `quotRem` 60- in DateTime (yy < 0) (abs (fromIntegral yy)) mm dd hhh mmm sss1 (Just (show sss2)) (Offset False (Just (hz < 0)) (Just hz) (Just mz))+ in DateTime (yy < 0) (abs (fromIntegral yy)) mm dd hhh mmm sss1 (Just (trimTail (== '0') (show sss2))) (Offset False (Just (hz < 0)) (Just hz) (Just mz)) -- | Parses the string in a @dateTime@ then converts to a zoned time and may fail with a parse error. zonedTime' :: String -> Either ParseError ZonedTime@@ -79,7 +79,7 @@ let (yy, mm, dd) = toGregorian d TimeOfDay hhh mmm sss = timeToTimeOfDay t (sss1, sss2) = properFraction sss- in DateTime (yy < 0) (abs (fromIntegral yy)) mm dd hhh mmm sss1 (Just (show sss2)) (Offset True Nothing Nothing Nothing)+ in DateTime (yy < 0) (abs (fromIntegral yy)) mm dd hhh mmm sss1 (Just (trimTail (== '0') (show sss2))) (Offset True Nothing Nothing Nothing) -- | Parses the string in a @dateTime@ then converts to a UTC time and may fail with a parse error. utcTime' :: String -> Either ParseError UTCTime@@ -168,3 +168,8 @@ if n > m then unexpected ("value " ++ show n ++ " exceeded maximum " ++ show m) else return n -- examples = ["2009-10-10T03:10:10-05:00", "2119-10-10T03:10:10.4-15:26", "0009-10-10T03:10:10+15:00", "2009-10-10T03:10:10Z", "-2009-05-10T21:08:59-05:00", "-9399-12-31T13:10:10+15:00", "-2009-10-10T03:10:10Z"]++-- not exported++trimTail :: (a -> Bool) -> [a] -> [a]+trimTail = (reverse .) . (. reverse) . dropWhile
xsd.cabal view
@@ -1,5 +1,5 @@ Name: xsd-Version: 0.3.1+Version: 0.3.2 License: BSD3 License-File: LICENSE Synopsis: XML Schema data structures@@ -8,7 +8,7 @@ Category: XML Author: Tony Morris Maintainer: code@tmorris.net-Copyright: 2009 Tony Morris+Copyright: 2010 Tony Morris build-type: Simple cabal-version: >= 1.2 @@ -17,9 +17,9 @@ Library if flag(small_base)- Build-Depends: base < 4 && >= 3, parsec, time+ Build-Depends: base < 5 && >= 3, parsec, time else- Build-Depends: base < 3, parsec, time+ Build-Depends: base < 5 && >= 3, parsec, time GHC-Options: -Wall Exposed-Modules: Text.XML.XSD