| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Regex.Internal.CharSet
Description
This is an internal module. You probably don't need to import this. Import Data.CharSet instead.
WARNING
Definitions in this module allow violating invariants that would otherwise be guaranteed by non-internal modules. Use at your own risk!
Synopsis
- newtype CharSet = CharSet {}
- empty :: CharSet
- singleton :: Char -> CharSet
- fromRange :: (Char, Char) -> CharSet
- fromList :: [Char] -> CharSet
- fromRanges :: [(Char, Char)] -> CharSet
- insert :: Char -> CharSet -> CharSet
- insertRange :: (Char, Char) -> CharSet -> CharSet
- delete :: Char -> CharSet -> CharSet
- deleteRange :: (Char, Char) -> CharSet -> CharSet
- map :: (Char -> Char) -> CharSet -> CharSet
- not :: CharSet -> CharSet
- union :: CharSet -> CharSet -> CharSet
- difference :: CharSet -> CharSet -> CharSet
- intersection :: CharSet -> CharSet -> CharSet
- member :: Char -> CharSet -> Bool
- notMember :: Char -> CharSet -> Bool
- elems :: CharSet -> [Char]
- ranges :: CharSet -> [(Char, Char)]
- valid :: CharSet -> Bool
Documentation
A set of Chars.
The members are stored as contiguous ranges of Chars. This is efficient
when the members form contiguous ranges since many Chars can be represented
with just one range.
fromRanges :: [(Char, Char)] -> CharSet Source #
\(O(n \min(n,C))\). Create a set from the given Char ranges (inclusive).
insertRange :: (Char, Char) -> CharSet -> CharSet Source #
\(O(\min(n,C))\). Insert all Chars in a range (inclusive) into a set.
deleteRange :: (Char, Char) -> CharSet -> CharSet Source #
\(O(\min(n,C))\). Delete a Char range (inclusive) from a set.
map :: (Char -> Char) -> CharSet -> CharSet Source #
\(O(s \min(s,C))\). Map a function over all Chars in a set.
union :: CharSet -> CharSet -> CharSet Source #
\(O(m \min(n+m,C))\). The union of two sets.
Prefer strict left-associative unions, since this is a strict structure and the runtime is linear in the size of the second argument.
difference :: CharSet -> CharSet -> CharSet Source #
\(O(m \min(n+m,C))\). The difference of two sets.