HORIZON HASKELLDocslts/ghc-10.0.x77a86622026-10-31Search packagesCtrl K
Theme: |

GHC 10.0.0.20260917 · lts/ghc-10.0.x · 77a8662 · 2026-10-31

Modulecharset-0.3.12Haskell2010

Data.CharSet

A CharSet is an efficient representation of a set of Char values designed for fast membership tests.

As an example build isAlpha will create a set of alphabetic characters. We can then use member on the generated set to efficiently test if a given Char represents an alphabetic character.

Designed to be imported qualified:

import Data.CharSet (CharSet)
import qualified Data.CharSet as CharSet
Contents
  1. Set type
  2. Operators
  3. Query
  4. Construction
  5. Combine
  6. Filter
  7. Map
  8. Fold
  9. Conversion
  10. List
  11. Ordered list
  12. IntMaps
  13. Array
Synopsis
  • Packagecharset-0.3.12
  • Exports32
  • LanguageHaskell2010
  • LicenceBSD-3-Clause
  • SourceCharSet.hs

Set type

datadata CharSet

Stored as a (possibly negated) IntSet and a fast set used for the head byte.

The set of valid (possibly negated) head bytes is stored unboxed as a 32-byte bytestring-based lookup table.

Constructors

Instances9Bounded, Eq, Data, Ord, Read, Show, …

Operators

Query

Construction

valuebuild :: (Char -> Bool) -> CharSet

Applies a predicate across the whole range of possible character values to create a set of only those characters which satisfy the predicate.

As an example build isAlpha will generate a CharSet of all alphabetic characters.

Combine

Filter

Map

Fold

Conversion

List

Ordered list

IntMaps

Array