X-Git-Url: http://git.cielonegro.org/gitweb.cgi?a=blobdiff_plain;f=Data%2FTime%2FHTTP%2FCommon.hs;h=c98338988bdaf17e7d69fb1a8b92d0a4de2e8e46;hb=02b5cc7bb95b32a2034afac3e918ff610c05f337;hp=84beeb3665cd9439f66f85bb5bae18197dfbe187;hpb=127b8db10ba98b77b5549902f4759f09a19604b1;p=time-http.git diff --git a/Data/Time/HTTP/Common.hs b/Data/Time/HTTP/Common.hs index 84beeb3..c983389 100644 --- a/Data/Time/HTTP/Common.hs +++ b/Data/Time/HTTP/Common.hs @@ -258,6 +258,7 @@ digit' = fromIntegral <$> fromC <$> P.digit fromC c = ord c - ord '0' show4digitsTZ ∷ TimeZone → AsciiBuilder +{-# INLINEABLE show4digitsTZ #-} show4digitsTZ tz = case timeZoneMinutes tz of offset | offset < 0 → A.toAsciiBuilder "-" ⊕ showTZ' (negate offset) @@ -270,6 +271,7 @@ show4digitsTZ tz show2 h ⊕ show2 m read4digitsTZ ∷ Parser TimeZone +{-# INLINEABLE read4digitsTZ #-} read4digitsTZ = do sign ← (char '+' *> return 1) <|> @@ -358,10 +360,4 @@ parseAttempt f p bs parseAttempt' ∷ Parser α → Ascii → Attempt α {-# INLINE parseAttempt' #-} -parseAttempt' p a = parseAttempt h p bs - where - h ∷ String → StringException - h _ = StringException $ A.toString a - - bs ∷ ByteString - bs = A.toByteString a +parseAttempt' = (∘ A.toByteString) ∘ parseAttempt StringException