regexdot-0.12.2.0: A polymorphic, POSIX, extended regex-engine.

Safe HaskellSafe
LanguageHaskell2010

RegExDot.Tree

Contents

Description

AUTHOR
Dr. Alistair Ward
DESCRIPTION
  • Defines a specific type of tree-structure, which is composed from either a datum, or a list of Tree-lists; https://en.wikipedia.org/wiki/Rose_Tree.
  • This more general tree-structure has the shape of a regular-expression match.
  • This contrasts with the typical binary-tree, which is either empty, or contains a (left Tree, datum, right Tree).
Synopsis

Types

Type-synonyms

Data-types

data Tree a Source #

A general purpose tree-type structure.

Constructors

Leaf a

The payload.

Node [TreeList a]

Recurse. N.B.: a list of lists is required to contain the MatchLists resulting from repeated Alternatives.

Instances
Functor Tree Source # 
Instance details

Defined in RegExDot.Tree

Methods

fmap :: (a -> b) -> Tree a -> Tree b #

(<$) :: a -> Tree b -> Tree a #

Foldable Tree Source # 
Instance details

Defined in RegExDot.Tree

Methods

fold :: Monoid m => Tree m -> m #

foldMap :: Monoid m => (a -> m) -> Tree a -> m #

foldr :: (a -> b -> b) -> b -> Tree a -> b #

foldr' :: (a -> b -> b) -> b -> Tree a -> b #

foldl :: (b -> a -> b) -> b -> Tree a -> b #

foldl' :: (b -> a -> b) -> b -> Tree a -> b #

foldr1 :: (a -> a -> a) -> Tree a -> a #

foldl1 :: (a -> a -> a) -> Tree a -> a #

toList :: Tree a -> [a] #

null :: Tree a -> Bool #

length :: Tree a -> Int #

elem :: Eq a => a -> Tree a -> Bool #

maximum :: Ord a => Tree a -> a #

minimum :: Ord a => Tree a -> a #

sum :: Num a => Tree a -> a #

product :: Num a => Tree a -> a #

Eq a => Eq (Tree a) Source # 
Instance details

Defined in RegExDot.Tree

Methods

(==) :: Tree a -> Tree a -> Bool #

(/=) :: Tree a -> Tree a -> Bool #

Read a => Read (Tree a) Source # 
Instance details

Defined in RegExDot.Tree

Show a => Show (Tree a) Source # 
Instance details

Defined in RegExDot.Tree

Methods

showsPrec :: Int -> Tree a -> ShowS #

show :: Tree a -> String #

showList :: [Tree a] -> ShowS #

NFData a => NFData (Tree a) Source # 
Instance details

Defined in RegExDot.Tree

Methods

rnf :: Tree a -> () #

Functions

pop Source #

Arguments

:: Tree a

The tree from which to extract the list of trees hanging immediately beneath its apex.

-> [TreeList a] 

Deconstruct the specified Node; i.e. lop the apex from the Tree, leaving a flat top.