|
Language.HaLex.RegExp | Portability | portable | Stability | provisional | Maintainer | jas@di.uminho.pt |
|
|
|
|
|
Description |
Regular Expressions in Haskell.
Code Included in the Lecture Notes on
Language Processing (with a functional flavour).
|
|
Synopsis |
|
|
|
|
Data type with recursion pattern
|
|
|
Type of regular expressions.
| Constructors | Empty | Empty Language
| Epsilon | Empty String
| Literal sy | Literals
| Or (RegExp sy) (RegExp sy) | Disjuncion
| Then (RegExp sy) (RegExp sy) | Sequence
| Star (RegExp sy) | Repetition, possibly zero time
| OneOrMore (RegExp sy) | One or more times (extended RegExp)
| Optional (RegExp sy) | Optional (extended RegExp)
|
| Instances | |
|
|
cataRegExp :: (re, re, re -> re -> re, re -> re, sy -> re, re -> re -> re, re -> re, re -> re) -> RegExp sy -> re | Source |
|
Catamorphism induced by the RegExp inductive data type
|
|
Matching
|
|
|
:: Eq sy | | => RegExp sy | (canonical) Regular Expression
| -> [sy] | Input Symbols
| -> Bool | | Test whether a match can be found for the given regular expression
in the given sequence of characters. The regular expression is
assumed not to contain OneOrMore or Optional. See also matches'.
|
|
|
|
:: Eq sy | | => RegExp sy | Regular Expression
| -> [sy] | Input Symbols
| -> Bool | | Test whether a match can be found for the given regular expression
in the given sequence of characters. The regular expression is
allowed to contain OneOrMore or Optional.
|
|
|
Size
|
|
|
:: | | => RegExp sy | Regular Expression
| -> Int | Size
| Compute the size of a regular expression.
We define the size of a regular expression as the number of occurrences
of symbols of the alfabeth
|
|
|
Printing
|
|
|
:: Show sy | | => RegExp sy | Regular Expression
| -> [Char] | String-based Regular Expression
| Print regular expression to String as a catamorphism.
A straightforward (catamorphic) show function.
(it produces too many brackets, making it difficult to read or
understand the expression)
|
|
|
Simplification
|
|
|
Simplify regular expressions according to the algebra of regular expressions.
|
|
Normalization
|
|
|
Rewrite extended regular expressions to
plain regular expression. This means that the OneOrMore
and Optional constructors are normalized away.
|
|
Produced by Haddock version 2.3.0 |