regex-deriv-0.0.5: Replaces/Enhances Text.Regex. Implementing regular expression matching using Brzozowski's Deriviatives

Safe HaskellNone
LanguageHaskell98

Text.Regex.Deriv.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) -> a Source

maxRange :: (a, b) -> b Source

type Letter = (Char, Int) Source

a character and its index (position)

class PosEpsilon a where Source

test for 'epsilon in a' epsilon-possession

Methods

posEpsilon :: a -> Bool Source

Instances

class IsEpsilon a where Source

test for epsilon == a

Methods

isEpsilon :: a -> Bool Source

Instances

IsEpsilon RE

function isEpsilon checks whether epsilon = r

IsEpsilon Pat 

class IsPhi a where Source

test for phi == a

Methods

isPhi :: a -> Bool Source

Instances

class Simplifiable a where Source

Methods

simplify :: a -> a Source

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

class IsGreedy a where Source

Methods

isGreedy :: a -> Bool Source

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