Safe Haskell | None |
---|---|
Language | Haskell2010 |
AUTHOR
- Dr. Alistair Ward
DESCRIPTION
- Implements
ShortcutExpander
Char
, to implement some of the traditional Perl-style shortcuts:
\d
- => Any
isDigit
-character. \D
- => Any non-
isDigit
character. \s
- => Any
isSpace
-character. \S
- => Any non-
isSpace
character. \w
- => Any
isWord
letter. \W
- => Any non-
isWord
letter.
- Enables one to compose concise regexen, containing any
Char
that's a member of one of these predefined sets. - Though
Meta
is polymorphic, & the type-parameter can't be assumed to implement eitherEnum
orOrd
,Char
actually does, so this module is able to implement ranges within a Bracket-expression. - Defines specialised instances of
Read
&Show
, to cope with Perl-style shortcuts, Posix Character-classes & Bracket-expression range-specifications.
- newtype MetaChar = MkMetaChar {
- deconstruct :: Meta Char
- metaCharParser :: Parser MetaChar
Types
Type-synonyms
A specialised instance, encapsulated to permit tailored instance-declarations.
Constants
Functions
metaCharParser :: Parser MetaChar Source #
Builds a parser of traditional regex-syntax, which understands Char
-specific concepts like Perl-style shortcuts & Posix Character-classes.