A parser and writer for the HTTP Link header as specified in RFC 5988 "Web Linking".

Version on this page:
LTS Haskell 16.19:
Stackage Nightly 2020-10-20:
Latest on Hackage:1.2.0

See all snapshots http-link-header appears in

LicenseRef-PublicDomain licensed by Greg V

Module documentation for

This version can be pinned in stack with:http-link-header-,1937

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