express-0.1.12: Dynamically-typed expressions involving applications and variables.
Copyright(c) 2019-2021 Rudy Matela
License3-Clause BSD (see the file LICENSE)
MaintainerRudy Matela <rudy@matela.com.br>
Safe HaskellNone
LanguageHaskell2010

Data.Express.Triexpr

Description

This module is part of Express.

An experimental data structure for matching Exprs.

Warning (1): Take care when importing this module, the interface is experimental and may change at every minor version.

Warning (2): YMMV: Do not expect this to be faster than manually matching in a list, provisional experiments show that it can be slower depending on the set of expressions being matched.

This module should be imported qualified as it exports definitions called map, lookup, toList, fromList, insert and empty:

import Data.Express.Triexpr (Triexpr)
import qualified Data.Express.Triexpr as T

Documentation

data Triexpr a Source #

Constructors

Triexpr [(Maybe Expr, Either (Triexpr a) (Expr, a))] 

Instances

Instances details
Eq a => Eq (Triexpr a) Source # 
Instance details

Defined in Data.Express.Triexpr

Methods

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

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

Ord a => Ord (Triexpr a) Source # 
Instance details

Defined in Data.Express.Triexpr

Methods

compare :: Triexpr a -> Triexpr a -> Ordering #

(<) :: Triexpr a -> Triexpr a -> Bool #

(<=) :: Triexpr a -> Triexpr a -> Bool #

(>) :: Triexpr a -> Triexpr a -> Bool #

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

max :: Triexpr a -> Triexpr a -> Triexpr a #

min :: Triexpr a -> Triexpr a -> Triexpr a #

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

Defined in Data.Express.Triexpr

Methods

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

show :: Triexpr a -> String #

showList :: [Triexpr a] -> ShowS #

unit :: Expr -> a -> Triexpr a Source #

insert :: Expr -> a -> Triexpr a -> Triexpr a Source #

toList :: Triexpr a -> [(Expr, a)] Source #

fromList :: [(Expr, a)] -> Triexpr a Source #

map :: (a -> b) -> Triexpr a -> Triexpr b Source #

lookup :: Expr -> Triexpr a -> [(Expr, [(Expr, Expr)], a)] Source #