fst-0.10.0.0: Finite state transducers

FST.RegTypes

Description

Functions for constructing a simplified regular expression.

Synopsis

# Type classes

class Combinators a whereSource

Combinators. The regular expressions are simplified while combined.

Methods

Arguments

 :: a -> a -> a Union

Arguments

 :: a -> a -> a Concatenation

Arguments

 :: a -> a Kleene's star

Arguments

 :: a -> a Kleene's plus

Arguments

 :: a Empty language

Instances

 Eq a => Combinators (Reg a) Eq a => Combinators (RReg a)

class Symbols f whereSource

Type class for the collection of symbols in an expression.

Methods

Arguments

 :: Eq a => f a -> [a] Collect the symbols in a regular expression.

Instances

 Symbols Reg Symbols RReg

# Types

data Reg a Source

Data type for a regular expression.

Constructors

 Empty Epsilon 0 All ? Symbol a a (Reg a) :|: (Reg a) r1 | r2 (Reg a) :.: (Reg a) r1 r2 (Reg a) :&: (Reg a) r1 & r2 Complement (Reg a) ~[ r1 ] Star (Reg a) r2 *

Instances

 Symbols Reg Eq a => Eq (Reg a) Show a => Show (Reg a) Eq a => Combinators (Reg a)

# Combinators

(<&>) :: Eq a => Reg a -> Reg a -> Reg aSource

Intersection

(<->) :: Eq a => Reg a -> Reg a -> Reg aSource

Minus. Definition A - B = A & ~B

complement :: Eq a => Reg a -> Reg aSource

Complement

reversal :: Eq a => Reg a -> Reg aSource

Reverse the language denoted by the regular expression.

allFree :: Eq a => Reg a -> [a] -> Reg aSource

Construct a ?-free regular expression with respect to an alphabet [a]

# Constructors

s :: a -> Reg aSource

Symbol

eps :: Reg aSource

Epsilon

All symbol

allToSymbols :: Eq a => [a] -> Reg aSource

Transform the `all` symbol to union over alphabet. ? -> [a|..] with respect to an alphabet [a]

# Query functions

acceptEps :: Eq a => Reg a -> BoolSource

Examines if a regular expression accepts the empty string.