Module
Type.Regex.Match
- Package
- purescript-typelevel-regex
- Repository
- thought2/purescript-typelevel-regex
#MatchRegex Source
class MatchRegex :: Regex -> Symbol -> Constraint
class MatchRegex (regex :: Regex) (str :: Symbol)
Instances
(RegexAttemptGo regex str rest matches, MatchRegexResult rest matches) => MatchRegex (Cat StartOfStr regex) str
(ScanRegexGo regex str rest matches, MatchRegexResult rest matches) => MatchRegex regex str
#MatchRegexResult Source
class MatchRegexResult :: Symbol -> Boolean -> Constraint
class MatchRegexResult (rest :: Symbol) (matches :: Boolean)
Instances
MatchRegexResult rest True
(Fail (Above (Text "Regex failed to match.") (Beside (Text "Unmatched rest is: ") (Text rest)))) => MatchRegexResult rest matches
#ScanRegexGo Source
class ScanRegexGo :: Regex -> Symbol -> Symbol -> Boolean -> Constraint
class ScanRegexGo (regex :: Regex) (str :: Symbol) (rest :: Symbol) (matches :: Boolean) | regex str -> rest matches
Instances
ScanRegexGo regex "" "" False
(RegexAttemptGo regex str rest matches, ScanRegexResult matches regex str rest' matches') => ScanRegexGo regex str rest' matches'
#ScanRegexResult Source
class ScanRegexResult :: Boolean -> Regex -> Symbol -> Symbol -> Boolean -> Constraint
class ScanRegexResult (result :: Boolean) (regex :: Regex) (str :: Symbol) (rest :: Symbol) (matches :: Boolean) | result regex str -> rest matches
Instances
ScanRegexResult True regex str rest True
ScanRegexResult False regex "" "" False
(Cons head tail str, ScanRegexGo regex tail rest matches) => ScanRegexResult False regex str rest matches
#RegexAttemptGo Source
class RegexAttemptGo :: Regex -> Symbol -> Symbol -> Boolean -> Constraint
class RegexAttemptGo (regex :: Regex) (str :: Symbol) (rest :: Symbol) (matches :: Boolean) | regex str -> rest matches
Instances
RegexAttemptGo Nil str str True
(IsFinalRegex regex True) => RegexAttemptGo regex "" "" True
(Cons head tail str, RegexAttemptMatch regex head tail rest matches) => RegexAttemptGo regex str rest matches
#RegexAttemptMatch Source
class RegexAttemptMatch :: Regex -> Symbol -> Symbol -> Symbol -> Boolean -> Constraint
class RegexAttemptMatch (regex :: Regex) (head :: Symbol) (tail :: Symbol) (rest :: Symbol) (matches :: Boolean) | regex head tail -> rest matches
Instances
RegexAttemptMatch (Lit (UnsafeMkChar head)) head tail tail True
RegexAttemptMatch Wildcard head tail tail True
(Contains chars head matches, Not matches matches') => RegexAttemptMatch (NotLits chars) head tail tail matches'
(Contains chars head matches) => RegexAttemptMatch (Lits chars) head tail tail matches
(Cons head tail str) => RegexAttemptMatch Nil head tail str True
(Cons head tail str, RegexAttemptGo regex1 str rest matches, RegexAttemptMatchCatResult regex2 matches rest rest' matches') => RegexAttemptMatch (Cat regex1 regex2) head tail rest' matches'
(Cons head tail str, RegexAttemptGo regex1 str restLeft matches, RegexAttemptMatchAltResult regex2 matches restLeft str rest' matches') => RegexAttemptMatch (Alt regex1 regex2) head tail rest' matches'
(Cons head tail sym, RegexAttemptGo regex sym restIn matches, RegexAttemptMatchManyResult matches regex sym restIn rest' matches') => RegexAttemptMatch (Many regex) head tail rest' matches'
RegexAttemptMatch regex head tail tail False
#RegexAttemptMatchCatResult Source
class RegexAttemptMatchCatResult :: Regex -> Boolean -> Symbol -> Symbol -> Boolean -> Constraint
class RegexAttemptMatchCatResult (regex :: Regex) (matched :: Boolean) (restIn :: Symbol) (restOut :: Symbol) (matches :: Boolean) | regex matched restIn -> restOut matches
Instances
(RegexAttemptGo regex restIn restOut matches) => RegexAttemptMatchCatResult regex True restIn restOut matches
RegexAttemptMatchCatResult regex False rest rest False
#RegexAttemptMatchAltResult Source
class RegexAttemptMatchAltResult :: Regex -> Boolean -> Symbol -> Symbol -> Symbol -> Boolean -> Constraint
class RegexAttemptMatchAltResult (regex :: Regex) (matched :: Boolean) (restInLeft :: Symbol) (restInRight :: Symbol) (restOut :: Symbol) (matches :: Boolean) | regex matched restInLeft restInRight -> restOut matches
Instances
RegexAttemptMatchAltResult regex True rest restInRight rest True
(RegexAttemptGo regex restIn restOut matches) => RegexAttemptMatchAltResult regex False restInLeft restIn restOut matches
#RegexAttemptMatchManyResult Source
class RegexAttemptMatchManyResult :: Boolean -> Regex -> Symbol -> Symbol -> Symbol -> Boolean -> Constraint
class RegexAttemptMatchManyResult (matched :: Boolean) (regex :: Regex) (backtrace :: Symbol) (restIn :: Symbol) (restOut :: Symbol) (matches :: Boolean) | matched regex backtrace restIn -> restOut matches
Instances
(RegexAttemptGo (Many regex) restIn restOut matches) => RegexAttemptMatchManyResult True regex backtrace restIn restOut matches
RegexAttemptMatchManyResult False regex backtrace restIn backtrace True
#IsFinalRegex Source
class IsFinalRegex :: Regex -> Boolean -> Constraint
class IsFinalRegex (regex :: Regex) (bool :: Boolean) | regex -> bool
Instances
IsFinalRegex EndOfStr True
IsFinalRegex Nil True
(IsFinalRegex regex1 bool1, IsFinalRegex regex2 bool2, Or bool1 bool2 bool) => IsFinalRegex (Alt regex1 regex2) bool
(IsFinalRegex regex1 bool1, IsFinalRegex regex2 bool2, And bool1 bool2 bool) => IsFinalRegex (Cat regex1 regex2) bool
IsFinalRegex (Many regex) True
IsFinalRegex regex False
#ContainsMatch Source
class ContainsMatch :: Symbol -> Symbol -> Symbol -> Boolean -> Constraint
class ContainsMatch (head :: Symbol) (tail :: Symbol) (char :: Symbol) (result :: Boolean) | head tail char -> result
Instances
ContainsMatch char tail char True
(Contains tail char result) => ContainsMatch head tail char result