| Copyright | (c) 2022 Tim Emiola |
|---|---|
| License | BSD3 |
| Maintainer | Tim Emiola <adetokunbo@emio.la> |
| Safe Haskell | Safe-Inferred |
| Language | Haskell2010 |
Redis.Glob.Internal
Description
Provides types that model redis glob patterns and combinators that can be used
to validate and interpret them.
Assumes that glob do not match the non-printable ASCII characters.
Synopsis
- data Part
- data InSquare
- parseParts :: ByteString -> Maybe [Part]
- parsePart :: ByteString -> Maybe Part
- fromParts :: [Part] -> ByteString
- fromPart :: Part -> ByteString
- reduceMany :: [Part] -> [Part]
- matchParts :: ByteString -> [Part] -> Bool
modelling Globs
Represents part of a valid redis glob pattern.
Represents part of a valid redis glob pattern.
Instances
parse / print valid Globs
parseParts :: ByteString -> Maybe [Part] Source #
Parse several from a glob Partpattern
fromParts :: [Part] -> ByteString Source #
Convert several to the form they can be parsed from.Parts
useful combinators
reduceMany :: [Part] -> [Part] Source #
Normalise parsed Parts
All but a terminating Many are replaced with GenerousMany;
Consecutive Manys are replaced by a single GenerousMany
matchParts :: ByteString -> [Part] -> Bool Source #
Confirm that a target ByteString matches the pattern provided as [.Part]