Portability | portable |
---|---|
Stability | experimental |
Maintainer | ekmett@gmail.com |
Safe Haskell | Trustworthy |
Fast set membership tests for Char
values
Stored as a (possibly negated) IntMap 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.
Designed to be imported qualified:
import Data.CharSet (CharSet) import qualified Data.CharSet as CharSet
- data CharSet = CharSet !Bool !ByteSet !IntSet
- (\\) :: CharSet -> CharSet -> CharSet
- null :: CharSet -> Bool
- size :: CharSet -> Int
- member :: Char -> CharSet -> Bool
- notMember :: Char -> CharSet -> Bool
- overlaps :: CharSet -> CharSet -> Bool
- isSubsetOf :: CharSet -> CharSet -> Bool
- isComplemented :: CharSet -> Bool
- build :: (Char -> Bool) -> CharSet
- empty :: CharSet
- singleton :: Char -> CharSet
- full :: CharSet
- insert :: Char -> CharSet -> CharSet
- delete :: Char -> CharSet -> CharSet
- complement :: CharSet -> CharSet
- range :: Char -> Char -> CharSet
- union :: CharSet -> CharSet -> CharSet
- intersection :: CharSet -> CharSet -> CharSet
- difference :: CharSet -> CharSet -> CharSet
- filter :: (Char -> Bool) -> CharSet -> CharSet
- partition :: (Char -> Bool) -> CharSet -> (CharSet, CharSet)
- map :: (Char -> Char) -> CharSet -> CharSet
- fold :: (Char -> b -> b) -> b -> CharSet -> b
- toList :: CharSet -> String
- fromList :: String -> CharSet
- toAscList :: CharSet -> String
- fromAscList :: String -> CharSet
- fromDistinctAscList :: String -> CharSet
- fromCharSet :: CharSet -> (Bool, IntSet)
- toCharSet :: IntSet -> CharSet
- toArray :: CharSet -> UArray Char Bool
Set type
Operators
Query
isSubsetOf :: CharSet -> CharSet -> BoolSource
isComplemented :: CharSet -> BoolSource
Construction
complement :: CharSet -> CharSetSource
Combine
intersection :: CharSet -> CharSet -> CharSetSource
difference :: CharSet -> CharSet -> CharSetSource
Filter
Map
Fold
Conversion
List
Ordered list
fromAscList :: String -> CharSetSource
IntMaps
fromCharSet :: CharSet -> (Bool, IntSet)Source