Portability | portable |
---|---|
Stability | experimental |
Maintainer | ekmett@gmail.com |
Encode unicode character sets as arbitrary precision floating point values using the least character in the set as the exponent. Can efficiently represent reasonably tightly grouped character sets, but may use up to 139KiB to represent a particularly sparse set.
Designed to be imported qualified:
import Data.CharSet (CharSet) import qualified Data.CharSet as CharSet
- data CharSet
- build :: (Char -> Bool) -> CharSet
- empty :: CharSet
- singleton :: Char -> CharSet
- full :: CharSet
- union :: CharSet -> CharSet -> CharSet
- intersection :: CharSet -> CharSet -> CharSet
- complement :: CharSet -> CharSet
- insert :: Char -> CharSet -> CharSet
- delete :: Char -> CharSet -> CharSet
- (\\) :: CharSet -> CharSet -> CharSet
- fromList :: String -> CharSet
- fromDistinctAscList :: String -> CharSet
- toArray :: CharSet -> Array Char Bool
- null :: CharSet -> Bool
- size :: CharSet -> Int
- member :: Char -> CharSet -> Bool
- elem :: Char -> CharSet -> Bool
- notElem :: Char -> CharSet -> Bool
- isComplemented :: CharSet -> Bool
- toInteger :: CharSet -> Integer
- posixAscii :: Map String CharSet
- data UnicodeCategory = UnicodeCategory String String CharSet String
- unicodeCategories :: [UnicodeCategory]
- control :: CharSet
- space :: CharSet
- lower :: CharSet
- upper :: CharSet
- alpha :: CharSet
- alphaNum :: CharSet
- print :: CharSet
- digit :: CharSet
- octDigit :: CharSet
- letter :: CharSet
- mark :: CharSet
- number :: CharSet
- punctuation :: CharSet
- symbol :: CharSet
- separator :: CharSet
- ascii :: CharSet
- latin1 :: CharSet
- asciiUpper :: CharSet
- asciiLower :: CharSet
CharSet
Manipulation
singleton :: Char -> CharSetSource
O(1) Construct a CharSet
with a single element. Permits O(1) null and size
complement :: CharSet -> CharSetSource
fromDistinctAscList :: String -> CharSetSource
O(d * n) Make a CharSet
from a distinct ascending list of items
Accessors
isComplemented :: CharSet -> BoolSource
O(1) check to see if we are represented as a complemented CharSet
.
toInteger :: CharSet -> IntegerSource
O(d) convert to an Integer representation. Discards negative elements