| Copyright | (c) 2019-2021 Rudy Matela |
|---|---|
| License | 3-Clause BSD (see the file LICENSE) |
| Maintainer | Rudy Matela <rudy@matela.com.br> |
| Safe Haskell | Safe-Inferred |
| Language | Haskell2010 |
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
Synopsis
- data Triexpr a = Triexpr [(Maybe Expr, Either (Triexpr a) (Expr, a))]
- empty :: Triexpr a
- unit :: Expr -> a -> Triexpr a
- merge :: Triexpr a -> Triexpr a -> Triexpr a
- insert :: Expr -> a -> Triexpr a -> Triexpr a
- toList :: Triexpr a -> [(Expr, a)]
- fromList :: [(Expr, a)] -> Triexpr a
- map :: (a -> b) -> Triexpr a -> Triexpr b
- lookup :: Expr -> Triexpr a -> [(Expr, [(Expr, Expr)], a)]
Documentation
Instances
| Eq a => Eq (Triexpr a) Source # | |
| Ord a => Ord (Triexpr a) Source # | |
| Show a => Show (Triexpr a) Source # | |