t-regex-0.1.0.0: Matchers and grammars using tree regular expressions

Safe HaskellNone
LanguageHaskell2010

Data.Regex.Example.Multi

Contents

Description

Example of tree regular expressions over a family of regular data types. Click on Source to view the code.

Synopsis

Data type definition

data Ty Source

Constructors

One 
Two 

Instances

Generic1m Ty Bis

Implementation of Generic1m for Bis. This is required to use tree regular expressions.

SingI Ty Two 
SingI Ty One 
ArbitraryM Ty (Fix Ty Bis) 
ShowM Ty (Fix Ty Bis) 
Eq (Sing Ty a) 
Show (Fix Ty Bis Two) 
Show (Fix Ty Bis One) 
data Sing Ty where 
type Rep1m Ty Bis = (:++:) Ty (Tag1m Ty (U1m (Ty -> *) Ty) One) ((:++:) Ty (Tag1m Ty ((:**:) (Ty -> *) Ty (K1m * (Ty -> *) Ty () Int) (Par1m Ty Two)) One) ((:++:) Ty (Tag1m Ty (U1m (Ty -> *) Ty) Two) (Tag1m Ty ((:**:) (Ty -> *) Ty (K1m * (Ty -> *) Ty () Char) (Par1m Ty One)) Two))) 

data Bis f ix where Source

Constructors

NilOne' :: Bis f One 
ConsOne' :: Int -> f Two -> Bis f One 
NilTwo' :: Bis f Two 
ConsTwo' :: Char -> f One -> Bis f Two 

Instances

Generic1m Ty Bis

Implementation of Generic1m for Bis. This is required to use tree regular expressions.

ArbitraryM Ty (Fix Ty Bis) 
ShowM Ty (Fix Ty Bis) 
Show (Fix Ty Bis Two) 
Show (Fix Ty Bis One) 
type Rep1m Ty Bis = (:++:) Ty (Tag1m Ty (U1m (Ty -> *) Ty) One) ((:++:) Ty (Tag1m Ty ((:**:) (Ty -> *) Ty (K1m * (Ty -> *) Ty () Int) (Par1m Ty Two)) One) ((:++:) Ty (Tag1m Ty (U1m (Ty -> *) Ty) Two) (Tag1m Ty ((:**:) (Ty -> *) Ty (K1m * (Ty -> *) Ty () Char) (Par1m Ty One)) Two))) 

Useful pattern synonyms

pattern (~) Ty t One => NilOne :: Fix Ty Bis t Source

pattern (~) Ty t One => ConsOne Int (Fix Ty Bis Two) :: Fix Ty Bis t Source

pattern (~) Ty t Two => NilTwo :: Fix Ty Bis t Source

pattern (~) Ty t Two => ConsTwo Char (Fix Ty Bis One) :: Fix Ty Bis t Source

Some Bis values

Tree regular expressions

Some stand-alone expressions

Using with views

Using the mrx quasi-quoter

Grammars