Copyright | (c) 2019-2024 Rudy Matela |
---|---|
License | 3-Clause BSD (see the file LICENSE) |
Maintainer | Rudy Matela <rudy@matela.com.br> |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
This module is part of Express.
An experimental data structure for matching Expr
s.
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
- newtype 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)]