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

Safe HaskellNone
LanguageHaskell2010

Data.Regex.Example.Mono

Contents

Description

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

Synopsis

Data type definitions

data Tree' f Source

The pattern functor, which should be kept open. Recursion is done by using the argument.

Constructors

Leaf' 
Branch' 

Fields

elt :: Int
 
left :: f
 
right :: f
 

Instances

type Tree = Fix Tree' Source

Closes the data type by creating its fix-point.

data Rose' f Source

The pattern functor for rose trees.

Constructors

Rose' 

Fields

value :: Int
 
child :: [f]
 

Instances

type Rose = Fix Rose' Source

Closes the data type by creating its fix-point.

Useful pattern synonyms

pattern Leaf :: Fix Tree' Source

Pattern synonym for the Leaf constructor inside Fix.

pattern Branch Int (Fix Tree') (Fix Tree') :: Fix Tree' Source

Pattern synonym for the Branch constructor inside Fix.

pattern Rose Int [Fix Rose'] :: Fix Rose' Source

Pattern synonym for the Rose constructor inside Fix.

Some Tree values

Some Rose values

Tree regular expressions

Useful pattern synonyms

pattern Leaf_ :: Regex' t t Tree' Source

pattern Branch_ Int (Regex' t t Tree') (Regex' t t Tree') :: Regex' t t Tree' Source

Some stand-alone expressions

Using with views

Using the rx quasi-quoter

Grammar and rules