bitset-word8: Space efficient set of Word8 and some pre-canned sets useful for parsing HTTP

[ concurrency, library, mit ] [ Propose Tags ]


Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees


  • No Candidates
Versions [RSS],,,,
Change log
Dependencies base (>=4.7 && <5), containers, template-haskell, th-lift-instances [details]
License MIT
Copyright 2017-2020 Naoto Shimazaki
Author Naoto Shimazaki
Category Concurrency
Home page
Bug tracker
Source repo head: git clone
Uploaded by nshimaza at 2020-07-28T06:26:55Z
Distributions LTSHaskell:, NixOS:, Stackage:
Reverse Dependencies 2 direct, 2 indirect [details]
Downloads 3700 total (27 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2020-07-28 [all 1 reports]

Readme for bitset-word8-

[back to package description]


License: MIT Build Status Hackage Stackage Nightly Stackage LTS

Space efficient set of Word8 and some pre-canned sets useful for parsing HTTP related ByteString. This package is intended to provide O(1) membership test on any subset of ASCII and Latin-1 character set in order to write efficient HTTP related parser.

Creating your own set

You can create your own set by fromList.

myCharSet :: BitSetWord8
myCharSet = fromList [ 'Y', 'y', 'N', 'n' ]

You can create pre-evaluated set using Template Haskell.

{-# LANGUAGE TemplateHaskell #-}
import Language.Haskell.TH.Syntax (Lift, lift)

myPreEvaluatedCharSet :: BitSetWord8
myPreEvaluatedCharSet = $(lift myCharSet)

Example Usage

import Data.Attoparsec.ByteString

-- | Parse RFC7230 token.
token :: Parser ByteString
token = takeWhile1 (member rfc7230TChar)