http-types 0.12.5 → 0.12.6
raw patch · 3 files changed
+21/−14 lines, 3 filesdep −arrayPVP ok
version bump matches the API change (PVP)
Dependencies removed: array
API changes (from Hackage documentation)
Files
- CHANGELOG.md +4/−0
- Network/HTTP/Types/Method.hs +15/−11
- http-types.cabal +2/−3
CHANGELOG.md view
@@ -1,5 +1,9 @@ # Changelog for `http-types` +## 0.12.6 [2026-08-13]++* Remove `array` dependency+ ## 0.12.5 [2026-05-31] * Add status `451 Unavailable For Legal Reasons`
Network/HTTP/Types/Method.hs view
@@ -1,5 +1,6 @@ {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE OverloadedStrings #-} -- | Types and constants for HTTP methods. --@@ -32,11 +33,9 @@ ) where -import Control.Arrow ((|||))-import Data.Array (Array, Ix, assocs, listArray, (!)) import qualified Data.ByteString as B-import qualified Data.ByteString.Char8 as B8 import Data.Data (Data)+import Data.Ix (Ix) import GHC.Generics (Generic) -- $setup@@ -123,13 +122,8 @@ -- The reason is that methodList is used with lookup. -- lookup is probably faster for these few cases than setting up an elaborate data structure. --- FIXME: listArray (minBound, maxBound) $ fmap fst methodList-methodArray :: Array StdMethod Method-methodArray = listArray (minBound, maxBound) $ map (B8.pack . show) [minBound :: StdMethod .. maxBound]---- FIXME: map (\m -> (B8.pack $ show m, m)) [minBound .. maxBound] methodList :: [(Method, StdMethod)]-methodList = map (\(a, b) -> (b, a)) (assocs methodArray)+methodList = map (\m -> (renderStdMethod m, m)) [minBound .. maxBound] -- | Convert a method 'B.ByteString' to a 'StdMethod' if possible. --@@ -143,10 +137,20 @@ -- -- @since 0.3.0 renderMethod :: Either B.ByteString StdMethod -> Method-renderMethod = id ||| renderStdMethod+renderMethod = either id renderStdMethod -- | Convert a 'StdMethod' to a 'B.ByteString'. -- -- @since 0.2.0 renderStdMethod :: StdMethod -> Method-renderStdMethod m = methodArray ! m+renderStdMethod method =+ case method of+ GET -> "GET"+ POST -> "POST"+ HEAD -> "HEAD"+ PUT -> "PUT"+ DELETE -> "DELETE"+ TRACE -> "TRACE"+ CONNECT -> "CONNECT"+ OPTIONS -> "OPTIONS"+ PATCH -> "PATCH"
http-types.cabal view
@@ -1,6 +1,6 @@ Cabal-version: 2.2 Name: http-types-Version: 0.12.5+Version: 0.12.6 Synopsis: Generic HTTP types for Haskell (for both client and server code). Description: Types and functions to describe and handle HTTP concepts. Including "methods", "headers", "query strings", "paths" and "HTTP versions".@@ -24,7 +24,7 @@ Source-repository this type: git location: https://github.com/Vlix/http-types.git- tag: v0.12.5+ tag: v0.12.6 Source-repository head type: git@@ -41,7 +41,6 @@ GHC-Options: -Wall Build-depends: base >= 4.8 && < 5, bytestring >= 0.10.6.0 && < 1,- array >= 0.5.1.0 && < 0.6, case-insensitive >= 1.2.0.2 && < 1.3, text >= 1.2.0.2 && < 3 Default-language: Haskell2010