regex-pderiv-0.1.0: Replaces/Enhances Text.Regex

Text.Regex.PDeriv.Common

Description

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

Synopsis

Documentation

type Range = (Int, Int)Source

(sub)words represent by range

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