git.iko.soy/typeable/postgresql-simple
on master help sign in
Rename the Time.Parser module to Time.Internal.Parser
commit78e898b17dd38e116ed35fe728a9ad7a22088e47 authorLeon P Smith <leon@melding-monads.com> dateSat 19 Sep 2015, 01:44 (11 years ago) parent0453f2c
3 files changed+8−7
postgresql-simple.cabal+1−1 src/Database/PostgreSQL/Simple/Time/Implementation.hs+5−3 src/Database/PostgreSQL/Simple/Time/Parser.hs → src/Database/PostgreSQL/Simple/Time/Internal/Parser.hs+2−3
postgresql-simple.cabal+1−1
@@ -49,7 +49,7 @@ Library
4949 Database.PostgreSQL.Simple.Compat
5050 Database.PostgreSQL.Simple.HStore.Implementation
5151 Database.PostgreSQL.Simple.Time.Implementation
52− Database.PostgreSQL.Simple.Time.Parser
52+ Database.PostgreSQL.Simple.Time.Internal.Parser
5353 Database.PostgreSQL.Simple.TypeInfo.Types
5454
5555 Build-depends:
src/Database/PostgreSQL/Simple/Time/Implementation.hs+5−3
@@ -28,7 +28,7 @@ import Database.PostgreSQL.Simple.Compat ((<>))
2828import Data.Monoid(Monoid(..))
2929import Data.Fixed (Pico)
3030import Unsafe.Coerce
31−import qualified Database.PostgreSQL.Simple.Time.Parser as TP
31+import qualified Database.PostgreSQL.Simple.Time.Internal.Parser as TP
3232import Database.PostgreSQL.Simple.Compat (fromPico)
3333
3434data Unbounded a
@@ -130,6 +130,7 @@ getUTCTime = TP.utcTime
130130getUTCTimestamp :: A.Parser UTCTimestamp
131131getUTCTimestamp = getUnbounded getUTCTime
132132
133+{--
133134toNum :: Num n => B.ByteString -> n
134135toNum = toNum_ 0
135136{-# INLINE toNum #-}
@@ -149,6 +150,7 @@ digits msg = do
149150 then return $! (10 * digit (c2w x) + digit (c2w y))
150151 else fail (msg <> " is not 2 digits")
151152{-# INLINE digits #-}
153+--}
152154
153155dayToBuilder :: Day -> Builder
154156dayToBuilder (toGregorian -> (y,m,d)) = do
@@ -205,8 +207,8 @@ nominalDiffTimeToBuilder xyz
205207 | otherwise = sign <> integerDec x <> char8 '.' <> showD6 y
206208 where
207209 sign = if xyz >= 0 then mempty else char8 '-'
208− -- A kludge to work around the fact that Data.Fixed isn't very fast and
209− -- NominalDiffTime doesn't give the MkNominalDiffTime constructor.
210+ -- A kludge to work around the fact that Data.Fixed isn't very fast and
211+ -- NominalDiffTime doesn't give the MkNominalDiffTime constructor.
210212 (x,yz) = ((unsafeCoerce (abs xyz) :: Integer) + 500000) `quotRem` 1000000000000
211213 (fromIntegral -> y, _z) = yz `quotRem` 1000000
212214
src/Database/PostgreSQL/Simple/Time/Parser.hs → src/Database/PostgreSQL/Simple/Time/Internal/Parser.hsrenamed+2−3
@@ -1,17 +1,16 @@
11{-# LANGUAGE BangPatterns, ScopedTypeVariables #-}
22
33-- |
4−-- Module: Database.PostgreSQL.Simple.Time.Parser
4+-- Module: Database.PostgreSQL.Simple.Time.Internal.Parser
55-- Copyright: (c) 2012-2015 Leon P Smith
66-- (c) 2015 Bryan O'Sullivan
77-- License: BSD3
88-- Maintainer: Leon P Smith <leon@melding-monads.com>
99-- Stability: experimental
10−-- Portability: portable
1110--
1211-- Parsers for parsing dates and times.
1312
14−module Database.PostgreSQL.Simple.Time.Parser
13+module Database.PostgreSQL.Simple.Time.Internal.Parser
1514 (
1615 day
1716 , localTime