packages feed

web-routes 0.27.11 → 0.27.12

raw patch · 2 files changed

+16/−16 lines, 2 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

+ Web.Routes.PathInfo: instance Web.Routes.PathInfo.PathInfo GHC.Int.Int64

Files

Web/Routes/PathInfo.hs view
@@ -32,6 +32,7 @@ import Control.Monad (msum) import Data.ByteString (ByteString) import qualified Data.ByteString.Char8 as B+import Data.Int (Int64) import Data.List as List (stripPrefix, tails) import Data.Text as Text (Text, pack, unpack, null, tails, stripPrefix) import Data.Text.Encoding (decodeUtf8)@@ -337,21 +338,20 @@  instance PathInfo Int where   toPathSegments i = [pack $ show i]-  fromPathSegments = pToken (const "Int") checkInt-   where checkInt txt =-           case signed decimal txt of-             (Left e) -> Nothing-             (Right (n, r))-                 | Text.null r -> Just n-                 | otherwise -> Nothing+  fromPathSegments = pToken (const "Int") checkIntegral  instance PathInfo Integer where   toPathSegments i = [pack $ show i]-  fromPathSegments = pToken (const "Integer") checkInt-   where checkInt txt =-           case signed decimal txt of-             (Left e) -> Nothing-             (Right (n, r))-                 | Text.null r -> Just n-                 | otherwise -> Nothing+  fromPathSegments = pToken (const "Integer") checkIntegral +instance PathInfo Int64 where+  toPathSegments i = [pack $ show i]+  fromPathSegments = pToken (const "Int64") checkIntegral++checkIntegral :: Integral a => Text -> Maybe a+checkIntegral txt =+  case signed decimal txt of+    (Left e) -> Nothing+    (Right (n, r))+       | Text.null r -> Just n+       | otherwise -> Nothing
web-routes.cabal view
@@ -1,5 +1,5 @@ Name:             web-routes-Version:          0.27.11+Version:          0.27.12 License:          BSD3 License-File:     LICENSE Author:           jeremy@seereason.com@@ -10,7 +10,7 @@ Homepage:         http://www.happstack.com/docs/crashcourse/index.html#web-routes Cabal-Version:    >= 1.8 Build-type:       Simple-tested-with:      GHC == 7.6.3, GHC == 7.8.4, GHC == 7.10.3+tested-with:      GHC == 7.8.4, GHC == 7.10.3, GHC == 8.0.1  test-suite Test   type             : exitcode-stdio-1.0