regex-pderiv-0.2.0: Replaces/Enhances Text.Regex. Implementing regular expression matching using Antimirov's partial derivatives.

Safe HaskellSafe
LanguageHaskell98

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 

Instances

Eq Range Source # 

Methods

(==) :: Range -> Range -> Bool #

(/=) :: Range -> Range -> Bool #

Show Range Source # 

Methods

showsPrec :: Int -> Range -> ShowS #

show :: Range -> String #

showList :: [Range] -> ShowS #

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

Minimal complete definition

posEpsilon

Methods

posEpsilon :: a -> Bool Source #

Instances

class IsEpsilon a where Source #

test for epsilon == a

Minimal complete definition

isEpsilon

Methods

isEpsilon :: a -> Bool Source #

Instances

IsEpsilon RE Source #

function isEpsilon checks whether epsilon = r

Methods

isEpsilon :: RE -> Bool Source #

IsEpsilon Pat Source # 

Methods

isEpsilon :: Pat -> Bool Source #

class IsPhi a where Source #

test for phi == a

Minimal complete definition

isPhi

Methods

isPhi :: a -> Bool Source #

Instances

IsPhi RE Source # 

Methods

isPhi :: RE -> Bool Source #

IsPhi Pat Source # 

Methods

isPhi :: Pat -> Bool Source #

class Simplifiable a where Source #

Minimal complete definition

simplify

Methods

simplify :: a -> a Source #

Instances

Simplifiable RE Source # 

Methods

simplify :: RE -> RE Source #

Simplifiable Pat Source #

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

Methods

simplify :: Pat -> Pat Source #

data GFlag Source #

The greediness flag

Constructors

Greedy

greedy

NotGreedy

not greedy

Instances

Eq GFlag Source # 

Methods

(==) :: GFlag -> GFlag -> Bool #

(/=) :: GFlag -> GFlag -> Bool #

Show GFlag Source # 

Methods

showsPrec :: Int -> GFlag -> ShowS #

show :: GFlag -> String #

showList :: [GFlag] -> ShowS #

class IsGreedy a where Source #

Minimal complete definition

isGreedy

Methods

isGreedy :: a -> Bool Source #

Instances

IsGreedy RE Source # 

Methods

isGreedy :: RE -> Bool Source #

IsGreedy Pat Source #

Function isGreedy checks whether a pattern is greedy

Methods

isGreedy :: Pat -> Bool Source #

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 #