1.8 KiB

Hackage unlicense Support me on Patreon


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"


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