attoparsec-0.14.4: Fast combinator parsing for bytestrings and text

Copyright | Bryan O'Sullivan 2007-2015
License | BSD3
Maintainer | bos@serpentine.com
Stability | experimental
Portability | unknown
Safe Haskell | None
Language | Haskell2010

Data.Attoparsec.ByteString.FastSet

Contents

- Data type
- Construction
- Lookup
- Debugging
- Handy interface

Description

Fast set membership tests for `Word8` and 8-bit `Char` values. The set representation is unboxed for efficiency. For small sets, we test for membership using a binary search. For larger sets, we use a lookup table.

Synopsis

- data FastSet
- fromList :: [Word8] -> FastSet
- set :: ByteString -> FastSet
- memberChar :: Char -> FastSet -> Bool
- memberWord8 :: Word8 -> FastSet -> Bool
- fromSet :: FastSet -> ByteString
- charClass :: String -> FastSet

# Data type

data FastSet Source #

#### Instances

Instances details

Show FastSet Source # |
Instance details Defined in Data.Attoparsec.ByteString.FastSet Methods showsPrec :: Int -> FastSet -> ShowS Source # show :: FastSet -> String Source # showList :: [FastSet] -> ShowS Source #
Eq FastSet Source # |
Instance details Defined in Data.Attoparsec.ByteString.FastSet Methods (==) :: FastSet -> FastSet -> Bool Source # (/=) :: FastSet -> FastSet -> Bool Source #
Ord FastSet Source # |
Instance details Defined in Data.Attoparsec.ByteString.FastSet Methods compare :: FastSet -> FastSet -> Ordering Source # (<) :: FastSet -> FastSet -> Bool Source # (<=) :: FastSet -> FastSet -> Bool Source # (>) :: FastSet -> FastSet -> Bool Source # (>=) :: FastSet -> FastSet -> Bool Source # max :: FastSet -> FastSet -> FastSet Source # min :: FastSet -> FastSet -> FastSet Source #

# Construction

fromList :: [Word8] -> FastSet Source #

set :: ByteString -> FastSet Source #

Create a set.

# Lookup

memberChar :: Char -> FastSet -> Bool Source #

Check the set for membership. Only works with 8-bit characters: characters above code point 255 will give wrong answers.

memberWord8 :: Word8 -> FastSet -> Bool Source #

Check the set for membership.

# Debugging

fromSet :: FastSet -> ByteString Source #

# Handy interface

charClass :: String -> FastSet Source #