Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
9c820b8
ci.yml: use custom project file for building with GHC 7.10.3
Vlix Aug 13, 2026
96b36c2
use 'word8' in 'Builder's, more hex usage, and some simplification/do…
Vlix Jun 29, 2026
ff5ab38
test: added test for lowercase percent encoded decoding
Vlix Jun 29, 2026
916d6aa
documentation improvements
Vlix Jun 29, 2026
4790ffe
added pattern synonyms for 'HttpVersion' constants
Vlix Jun 29, 2026
1c598de
add more header constants and unit tests for the new constants
Vlix Jun 29, 2026
10d992c
update CHANGELOG
Vlix Jun 29, 2026
dce0962
add status pattern synonyms
Vlix Jun 29, 2026
b82eca7
add render functions for the 'Status'
Vlix Jun 29, 2026
72ae6a7
test: unit tests for 'Status' rendering, and fixing found errors
Vlix Jun 29, 2026
d127ab9
add parsing of status codes
Vlix Jun 29, 2026
c57bf86
test: add testing of parsing of status codes
Vlix Jun 29, 2026
8a06339
CHANGELOG entry about parsing/rendering status codes, and fixing the …
Vlix Jun 29, 2026
8210aa8
fixes to build with GHC 7.10.3
Vlix Jun 29, 2026
7c06add
hopefully fix building with GHC 7.10.3
Vlix Jun 29, 2026
d9f93bc
unsafeWithForeignPtr fix
Vlix Jun 29, 2026
301c0ed
more 7.10.3 fixes
Vlix Jun 29, 2026
218bdd6
more fixes
Vlix Jun 29, 2026
0847f30
test: add pattern match tests for the pattern synonyms
Vlix Jun 29, 2026
c78e02e
miscellaneous adjustments
Vlix Jul 2, 2026
6c4c96f
bump version to 0.13.0
Vlix Aug 13, 2026
1be5723
haddock should display 'since 0.13.0'
Vlix Aug 13, 2026
2afc1e9
ci: better caching
Vlix Aug 13, 2026
b623989
change version bump to 0.12.7
Vlix Aug 19, 2026
a5e7c7b
change 'Status' pattern synonym to 'StatusCode' instead of individual…
Vlix Aug 19, 2026
88ae28f
test: fix 'Status' pattern synonym tests and add 'COMPLETE' pragma to…
Vlix Aug 19, 2026
5dc3291
ci: cache cabal
Vlix Aug 19, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
211 changes: 122 additions & 89 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,52 +8,25 @@ on:
- reopened
- synchronize
paths:
- '**.hs'
- '**.cabal'
- 'stack.yaml'
- '.github/workflows/ci.yml'
- "**.hs"
- "**.cabal"
- "stack.yaml"
- ".github/workflows/ci.yml"
push:
branches: [master]

jobs:
# Just to test very old compiler for low base version dependency
oldest:
name: oldest / ghc-7.10.3 / ubuntu
runs-on: ubuntu-latest
steps:

- uses: actions/checkout@v4

- uses: haskell-actions/setup@v2
id: setup-haskell-cabal
name: Setup Haskell
with:
ghc-version: "7.10.3"
cabal-version: 3.0.0.0

- uses: actions/cache@v3
name: Cache cabal-store
with:
path: ${{ steps.setup-haskell-cabal.outputs.cabal-store }}
key: ubuntu-7.10.3-cabal

- name: Build
run: |
cabal build --ghc-option='-Wall' \
--constraint="bytestring==0.10.6.0" \
--constraint="array==0.5.1.0" \
--constraint="case-insensitive==1.2.0.2" \
--constraint="text==1.2.0.2"

cabal:
env:
MANUAL_RESET: v5
name: cabal / ghc-${{matrix.ghc}} / ${{ matrix.os }}
continue-on-error: ${{ matrix.ghc == '9.14.1'}}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-latest
- macOS-latest
# - macOS-latest # Is giving issues for some reason
cabal: ["latest"]
ghc:
- "9.6.7"
Expand All @@ -63,38 +36,53 @@ jobs:
- "9.14.1"

steps:
- uses: actions/checkout@v4

- uses: haskell-actions/setup@v2
id: setup-haskell-cabal
name: Setup Haskell
with:
ghc-version: ${{ matrix.ghc }}
cabal-version: ${{ matrix.cabal }}
cabal-update: true

- uses: actions/cache@v3
name: Cache cabal-store
with:
path: ${{ steps.setup-haskell-cabal.outputs.cabal-store }}
key: ${{ runner.os }}-${{ matrix.ghc }}-cabal

- name: Build
run: |
cabal build all --enable-tests --enable-benchmarks --write-ghc-environment-files=always --ghc-option='-Wall'
- name: Test
run: |
cabal test test:spec --enable-tests --ghc-option='-Wall'
- name: Test Docs
run: |
cabal exec -- cabal test test:doctests --enable-tests --ghc-option='-Wall'
- uses: actions/checkout@v4

- name: Cache GHCup
uses: actions/cache@v6
id: ghcup-cache
with:
path: |
~/.ghcup/bin/*
~/.ghcup/cache/*
~/.ghcup/config.yaml
~/.ghcup/ghc/${{ matrix.ghc }}
~/.ghcup/cabal/**/cabal
key: CI-ghcup-cabal-${{ env.MANUAL_RESET }}-${{ matrix.ghc }}

- name: Setup Haskell
if: steps.ghcup-cache.outputs.cache-hit != 'true'
uses: haskell-actions/setup@v2
id: setup-haskell-cabal
with:
ghc-version: ${{ matrix.ghc }}
cabal-version: ${{ matrix.cabal }}
cabal-update: true

- name: Cache cabal
uses: actions/cache@v6
with:
path: ~/.cabal
key: ${{ matrix.ghc }}-cabal

- name: Build
run: |
cabal build all --enable-tests --enable-benchmarks --write-ghc-environment-files=always --ghc-option='-Wall'
- name: Test
run: |
cabal test test:spec --enable-tests --ghc-option='-Wall'
- name: Test Docs
run: |
cabal exec -- cabal test test:doctests --enable-tests --ghc-option='-Wall'
# # We probably want to add benchmarks at some point, just to make sure
# # functions don't regress in performance too much?
# - name: Bench
# run: |
# cabal bench --enable-benchmarks
stack:
name: stack ${{ matrix.resolver }}
env:
MANUAL_RESET: v3
runs-on: ubuntu-latest
# This makes the CI jobs not all be cancelled if nightly fails to build.
# However, if nightly fails to build, CI still gets a red X in the GitHub UI.
Expand All @@ -104,40 +92,85 @@ jobs:
# When some sort of `allow-failure` functionality is available in GitHub
# actions, we should switch to it:
# https://github.com/actions/toolkit/issues/399
continue-on-error: ${{ matrix.resolver == '--resolver nightly' }}
continue-on-error: ${{ matrix.resolver == 'nightly' || matrix.resolver == 'lts-12' }}
strategy:
matrix:
stack: ["latest"]
resolver:
- "--resolver lts-22" # GHC 9.6.7
- "--resolver lts-23" # GHC 9.8.4
- "--resolver lts-24" # GHC 9.10.3
- "--resolver nightly" # GHC 9.12.4
include:
- resolver: "lts-12"
ghc: "8.4.4"
- resolver: "lts-22"
ghc: "9.6.7"
- resolver: "lts-23"
ghc: "9.8.4"
- resolver: "lts-24"
ghc: "9.10.3"
- resolver: "nightly"
ghc: "9.12.4"

steps:
- uses: actions/checkout@v4

- uses: haskell-actions/setup@v2
name: Setup Haskell Stack
with:
stack-version: ${{ matrix.stack }}
enable-stack: true

- uses: actions/cache@v3
name: Cache ~/.stack
with:
path: ${{ steps.setup-haskell-cabal.outputs.stack-root }}
key: ${{ runner.os }}-${{ matrix.resolver }}-stack

- name: Build
run: |
stack build ${{ matrix.resolver }} --test --bench --no-run-tests --no-run-benchmarks --ghc-options='-Wall'
- name: Test
run: |
stack test --no-rerun-tests http-types:test:spec ${{ matrix.resolver }}
- name: Test Docs
run: |
stack test http-types:test:doctests ${{ matrix.resolver }}
- uses: actions/checkout@v4

- name: Cache GHCup
uses: actions/cache@v6
id: ghcup-cache
with:
path: |
~/.ghcup/bin/*
~/.ghcup/cache/*
~/.ghcup/config.yaml
~/.ghcup/ghc/${{ matrix.ghc }}
~/.ghcup/stack/*
key: CI-ghcup-stack-${{ env.MANUAL_RESET }}-${{ matrix.ghc }}

- name: Setup Haskell Stack
uses: haskell-actions/setup@v2
if: steps.ghcup-cache.outputs.cache-hit != 'true'
with:
stack-version: "latest"
ghc-version: ${{ matrix.ghc }}
enable-stack: true
stack-setup-ghc: false

- name: Cache Pantry (Stackage package index)
id: pantry
uses: actions/cache@v6
with:
path: ~/.stack/pantry
key: CI-pantry-${{ env.MANUAL_RESET }}-${{ matrix.resolver }}

- name: Recompute Stackage package index
if: steps.pantry.outputs.cache-hit != 'true'
run: stack update # populates ~/.stack/pantry

- name: Cache Dependencies
uses: actions/cache@v6
with:
path: |
~/.stack/stack.sqlite3
~/.stack/snapshots
key: ${{ runner.os }}-${{ matrix.resolver }}-stack

- name: Build lts-12
if: "${{ matrix.resolver == 'lts-12' }}"
run: |
stack config set system-ghc true --global
stack build --resolver=${{ matrix.resolver }} --ghc-options='-Wall'

- name: Build
if: "${{ matrix.resolver != 'lts-12' }}"
run: |
stack config set system-ghc true --global
stack build --resolver=${{ matrix.resolver }} --test --bench \
--no-run-tests --no-run-benchmarks --ghc-options='-Wall'
- name: Test
if: "${{ matrix.resolver != 'lts-12' }}"
run: |
stack test --no-rerun-tests http-types:test:spec --resolver=${{ matrix.resolver }}
- name: Test Docs
if: "${{ matrix.resolver != 'lts-12' }}"
run: |
stack test http-types:test:doctests --resolver=${{ matrix.resolver }}

# # We probably want to add benchmarks at some point, just to make sure
# # functions don't regress in performance too much?
# - name: Bench
Expand Down
27 changes: 27 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,33 @@
* Add support for the QUERY method and Accept-Query response field name from
[RFC 10008](https://www.rfc-editor.org/rfc/rfc10008.html).

## 0.12.7 [unreleased]

* Add parsing and rendering functions for `Status`
* Add pattern synonyms for `HttpVersion`
* `Http09`
* `Http10`
* `Http11`
* `Http20`
* `Http30`
* Add pattern synonyms for `Status` as `StatusCode` to only match the 3 digit code
* Add more constant headers:
* `hAcceptPatch`
* `hAccessControlAllowCredentials`
* `hAccessControlAllowHeaders`
* `hAccessControlAllowMethods`
* `hAccessControlAllowOrigin`
* `hAccessControlExposeHeaders`
* `hAccessControlMaxAge`
* `hAccessControlRequestMethod`
* `hAltSvc`
* `hContentDigest`
* `hContentSecurityPolicy`
* `hContentSecurityPolicyReportOnly`
* `hForwarded`
* `hLink`
* `hStrictTransportSecurity`

## 0.12.6 [2026-08-13]

* Remove `array` dependency
Expand Down
34 changes: 29 additions & 5 deletions Network/HTTP/Types.hs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ module Network.HTTP.Types (
-- * Methods

-- | __For more information__: "Network.HTTP.Types.Method"

Method,

-- ** Constants
Expand All @@ -26,7 +25,6 @@ module Network.HTTP.Types (
-- * Versions

-- | __For more information__: "Network.HTTP.Types.Version"

HttpVersion (..),
http09,
http10,
Expand All @@ -37,11 +35,20 @@ module Network.HTTP.Types (
-- * Status

-- | __For more information__: "Network.HTTP.Types.Status"

Status (..),
mkStatus,

-- ** Parsing and Rendering
parseStatusCode,
renderStatusCode,
parseFullStatus,
renderFullStatus,

-- ** Low level functions
renderStatusCodeToPtr,
renderFullStatusToPtr,

-- ** Constants
mkStatus,
status100,
continue100,
status101,
Expand Down Expand Up @@ -140,6 +147,8 @@ module Network.HTTP.Types (
httpVersionNotSupported505,
status511,
networkAuthenticationRequired511,

-- *** Category checks
statusIsInformational,
statusIsSuccessful,
statusIsRedirection,
Expand All @@ -156,31 +165,44 @@ module Network.HTTP.Types (
RequestHeaders,
ResponseHeaders,

-- ** Header constants
-- ** Constants
hAccept,
hAcceptCharset,
hAcceptEncoding,
hAcceptLanguage,
hAcceptPatch,
hAcceptQuery,
hAcceptRanges,
hAccessControlAllowCredentials,
hAccessControlAllowHeaders,
hAccessControlAllowMethods,
hAccessControlAllowOrigin,
hAccessControlExposeHeaders,
hAccessControlMaxAge,
hAccessControlRequestMethod,
hAge,
hAllow,
hAltSvc,
hAuthorization,
hCacheControl,
hConnection,
hContentDigest,
hContentDisposition,
hContentEncoding,
hContentLanguage,
hContentLength,
hContentLocation,
hContentMD5,
hContentRange,
hContentSecurityPolicy,
hContentSecurityPolicyReportOnly,
hContentType,
hCookie,
hDate,
hETag,
hExpect,
hExpires,
hForwarded,
hFrom,
hHost,
hIfMatch,
Expand All @@ -189,6 +211,7 @@ module Network.HTTP.Types (
hIfRange,
hIfUnmodifiedSince,
hLastModified,
hLink,
hLocation,
hMaxForwards,
hMIMEVersion,
Expand All @@ -203,6 +226,7 @@ module Network.HTTP.Types (
hRetryAfter,
hServer,
hSetCookie,
hStrictTransportSecurity,
hTE,
hTrailer,
hTransferEncoding,
Expand Down
Loading
Loading