regex-pderiv-0.1.2: Replaces/Enhances Text.Regex. Implementing regular expression matching using Antimirov's partial derivatives. The svn source also shipped with two other referential implementations, e.g. Thomspon NFA and Glushkov NFA. For more detail please check out http://code.google.com/p/xhaskell-library/

Safe HaskellSafe-Infered

Text.Regex.PDeriv.Common

Description

this module contains the defs of common data types and type classes

Synopsis

Documentation

data Range Source

(sub)words represent by range type Range = (Int,Int)

Constructors

Range !Int !Int 

minRange :: (a, b) -> aSource

maxRange :: (a, b) -> bSource

type Letter = (Char, Int)Source

a character and its index (position)

class PosEpsilon a whereSource

test for 'epsilon in a' epsilon-possession

Methods

posEpsilon :: a -> BoolSource

Instances

class IsEpsilon a whereSource

test for epsilon == a

Methods

isEpsilon :: a -> BoolSource

Instances

IsEpsilon RE

function isEpsilon checks whether epsilon = r

IsEpsilon Pat 

class IsPhi a whereSource

test for phi == a

Methods

isPhi :: a -> BoolSource

Instances

class Simplifiable a whereSource

Methods

simplify :: a -> aSource

Instances

Simplifiable RE 
Simplifiable Pat

mainly interested in simplifying epsilon, p --> p could be made more optimal, e.g. (epsilon, epsilon) --> epsilon

data GFlag Source

The greediness flag

Constructors

Greedy

greedy

NotGreedy

not greedy

Instances

class IsGreedy a whereSource

Methods

isGreedy :: a -> BoolSource

Instances

IsGreedy RE 
IsGreedy Pat

Function isGreedy checks whether a pattern is greedy

nub2 :: [(Int, a)] -> [(Int, a)]Source

remove duplications in a list of pairs, using the first components as key.

nub3 :: [(Int, a, Int)] -> [(Int, a, Int)]Source