web-routes 0.27.14.4 → 0.27.15
raw patch · 2 files changed
+39/−6 lines, 2 filesdep ~mtl
Dependency ranges changed: mtl
Files
- Web/Routes/PathInfo.hs +36/−3
- web-routes.cabal +3/−3
Web/Routes/PathInfo.hs view
@@ -32,12 +32,13 @@ import Control.Monad (msum) import Data.ByteString (ByteString) import qualified Data.ByteString.Char8 as B-import Data.Int (Int64)+import Data.Int (Int8, Int16, Int32, Int64) import Data.List as List (stripPrefix, tails) import Data.Text as Text (Text, pack, unpack, null, tails, stripPrefix) import Data.Text.Encoding (decodeUtf8) import Data.Text.Read (decimal, signed) import Data.Maybe (fromJust)+import Data.Word (Word, Word8, Word16, Word32, Word64) import Network.HTTP.Types import Text.ParserCombinators.Parsec.Combinator (notFollowedBy) import Text.ParserCombinators.Parsec.Error (ParseError, errorPos, errorMessages, showErrorMessages)@@ -340,13 +341,45 @@ toPathSegments i = [pack $ show i] fromPathSegments = pToken (const "Int") checkIntegral -instance PathInfo Integer where+instance PathInfo Int8 where toPathSegments i = [pack $ show i]- fromPathSegments = pToken (const "Integer") checkIntegral+ fromPathSegments = pToken (const "Int8") checkIntegral +instance PathInfo Int16 where+ toPathSegments i = [pack $ show i]+ fromPathSegments = pToken (const "Int16") checkIntegral++instance PathInfo Int32 where+ toPathSegments i = [pack $ show i]+ fromPathSegments = pToken (const "Int32") checkIntegral+ instance PathInfo Int64 where toPathSegments i = [pack $ show i] fromPathSegments = pToken (const "Int64") checkIntegral++instance PathInfo Integer where+ toPathSegments i = [pack $ show i]+ fromPathSegments = pToken (const "Integer") checkIntegral++instance PathInfo Word where+ toPathSegments i = [pack $ show i]+ fromPathSegments = pToken (const "Word") checkIntegral++instance PathInfo Word8 where+ toPathSegments i = [pack $ show i]+ fromPathSegments = pToken (const "Word8") checkIntegral++instance PathInfo Word16 where+ toPathSegments i = [pack $ show i]+ fromPathSegments = pToken (const "Word16") checkIntegral++instance PathInfo Word32 where+ toPathSegments i = [pack $ show i]+ fromPathSegments = pToken (const "Word32") checkIntegral++instance PathInfo Word64 where+ toPathSegments i = [pack $ show i]+ fromPathSegments = pToken (const "Word64") checkIntegral checkIntegral :: Integral a => Text -> Maybe a checkIntegral txt =
web-routes.cabal view
@@ -1,5 +1,5 @@ Name: web-routes-Version: 0.27.14.4+Version: 0.27.15 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.10 Build-type: Simple-tested-with: GHC==8.0.2, GHC==8.2.2, GHC==8.4.1, GHC==8.6.5, GHC==8.8.4, GHC==8.10.7, GHC==9.0.2, GHC==9.2.2+tested-with: GHC==8.0.2, GHC==8.2.2, GHC==8.4.1, GHC==8.6.5, GHC==8.8.4, GHC==8.10.7, GHC==9.0.2, GHC==9.2.5, GHC==9.4.2 test-suite Test Default-Language : Haskell2010@@ -31,7 +31,7 @@ parsec >= 2 && < 4, bytestring >= 0.9 && < 0.12, http-types >= 0.6 && < 0.13,- mtl >= 2.0 && < 2.3,+ mtl >= 2.0 && < 2.4, text >= 0.11 && < 2.1, utf8-string >= 0.3 && < 1.1, exceptions >= 0.6.1 && < 0.11