regexdot-0.12.0.1: A polymorphic, POSIX, extended regex-engine.

RegExDot.Meta

Description

AUTHOR
Dr. Alistair Ward
DESCRIPTION
• Describes the set of polymorphic data, which can be matched.
• Only permits a match against exactly one polymorphic datum, which distinguishes it from a zero-width assertion, like an anchor, word-boundary, or look-ahead assertion.
• Designed to be used by a polymorphic regex-engine, to implement the traditional meta-characters; . [] [^].
• Permits Perl-style shortcuts for commonly used Meta-data, to be canned & assigned a single-Char mnemonic for subsequent reference; the implementation of Read looks for a back-slashed Char, for which it expects there to be a corresponding canned Meta. Since this class is polymorphic, it has no knowledge of what shortcuts might be appropriate for the chosen type-parameter, so the expansion from the back-slashed Char to corresponding Meta-data, is performed through the expand interface of the ShortcutExpander class, which should be implemented elsewhere.

Synopsis

# Type-classes

class ShortcutExpander m => ShortcutExpander m where Source #

• The interface via which Perl-style shortcuts are expanded, in a manner appropriate to the chosen type-parameter.
• Since the expansion of Perl-style shortcuts, is more restricted inside than outside a BracketExpression, the former is considered to be a superclass, providing a base from which to build alternative implementations.

Minimal complete definition

expand

Methods

# Types

## Data-types

data Meta m Source #

Declares a polymorphic data-type.

Constructors

 Any Any datum matches. Equivalent to NoneOf [], but more efficient. CAVEAT: independent of the type-parameter a. Literal m The datum matches, if it's equal to the specified value. Equivalent to AnyOf [BracketExpression.Literal x], but more efficient. AnyOf (BracketExpression m) The datum matches, if containsMatch. NoneOf (BracketExpression m) The datum matches, if not BracketExpression.containsMatch. Predicate (ShowablePredicate m) The datum matches if ShowablePredicate.

Instances

 Eq m => Eq (Meta m) Source # Methods(==) :: Meta m -> Meta m -> Bool #(/=) :: Meta m -> Meta m -> Bool # (ShortcutExpander m, Read m) => Read (Meta m) Source # MethodsreadsPrec :: Int -> ReadS (Meta m) #readList :: ReadS [Meta m] # Show m => Show (Meta m) Source # MethodsshowsPrec :: Int -> Meta m -> ShowS #show :: Meta m -> String #showList :: [Meta m] -> ShowS # NFData m => NFData (Meta m) Source # Methodsrnf :: Meta m -> () # Source # MethodsgetErrors :: Meta m -> [String] #isValid :: Meta m -> Bool # Consumer (Meta m) Source # MethodsstarHeight :: Meta m -> StarHeight Source #

# Constants

The token used to precede a Perl-style shortcut, when in the String-form.

The token used to denote Any, when in the String-form.

The set of Char to which a specific meaning is attributed, when reading from String.

# Functions

## Predicates

Arguments

 :: Eq m => m The input datum. -> Meta m The meta-entity against which the input datum is to be matched. -> Bool The result of the match-operation.

True if the specified datum matches.