A parser and writer for the HTTP Link header per RFC 5988

Version on this page:1.2.1
LTS Haskell 22.25:1.2.1@rev:3
Stackage Nightly 2024-06-16:1.2.1@rev:3
Latest on Hackage:1.2.1@rev:3

See all snapshots http-link-header appears in

LicenseRef-PublicDomain licensed by Greg V
Maintained by [email protected]
This version can be pinned in stack with:http-link-header-1.2.1@sha256:bf6ed17d20d53379016b91363aad14dd74ce3e1eaa98c58c67fc8f2c5223a0c0,2247

Module documentation for 1.2.1

http-link-header Hackage Build Status Coverage Status unlicense

A Haskell library than implements a parser and a writer for the HTTP Link header as specified in RFC 5988 “Web Linking”.


import Network.HTTP.Link
import Network.URI
import Data.Maybe

----- Writing
writeLinkHeader [ Link (fromJust $ parseURI "") [(Rel, "next"), (Title, "hello world")]
                , Link (fromJust $ parseURI "https://yolo.tld") [(Rel, "license")] ]
-- "<>; rel=\"next\"; title=\"hello world\", <https://yolo.tld>; rel=\"license\""

----- Parsing
parseLinkHeader "<>; rel=\"next\", <>; rel=prev"
-- Just [ Link [(Rel, "next")]
--      , Link [(Rel, "prev")] ]


Use stack to build.
Use ghci to run tests quickly with :test (see the .ghci file).

$ stack build

$ stack test && rm tests.tix

$ stack bench

$ stack ghci --ghc-options="-fno-hpc"


Please feel free to submit pull requests! Bugfixes and simple non-breaking improvements will be accepted without any questions :-)

By participating in this project you agree to follow the Contributor Code of Conduct.

The list of contributors is available on GitHub.


This is free and unencumbered software released into the public domain.
For more information, please refer to the UNLICENSE file or