Copyright | (c) 2022 Tim Emiola |
---|---|
License | BSD3 |
Maintainer | Tim Emiola <adetokunbo@emio.la> |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
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.
parse / print valid Globs
parseParts :: ByteString -> Maybe [Part] Source #
Parse several
from a glob Part
pattern
fromParts :: [Part] -> ByteString Source #
Convert several
to the form they can be parsed from.Part
s
useful combinators
reduceMany :: [Part] -> [Part] Source #
Normalise parsed Part
s
All but a terminating Many
are replaced with GenerousMany;
Consecutive Many
s are replaced by a single GenerousMany
matchParts :: ByteString -> [Part] -> Bool Source #
Confirm that a target
ByteString
matches the pattern provided as [
.Part
]