| Copyright | (c) Nicolás Rodríguez 2021 |
|---|---|
| License | GPL-3 |
| Maintainer | Nicolás Rodríguez |
| Stability | experimental |
| Portability | POSIX |
| Safe Haskell | Safe |
| Language | Haskell2010 |
Data.Tree.BST.Extern.Lookup
Description
Implementation of the lookup algorithm over ITree trees for externalist BST trees.
Documentation
class Lookupable (x :: Nat) (a :: Type) (t :: Tree) where Source #
This type class provides the functionality to lookup a node with key x
in a non empty tree t without checking any structural invariant (key ordering).
The lookup is defined at the value level and the type level, and is performed
as if the tree is a BST.
It's necessary to know the type a of the value stored in node with key x
so that the type of the value returned by lookup may be specified.
Methods
lookup :: (t ~ 'ForkTree l (Node n a1) r, Member x t t ~ 'True) => Proxy x -> ITree t -> a Source #
Lookup the given key in the tree.
Instances
| (t ~ 'ForkTree l (Node n a1) r, a ~ LookupValueType x t t, o ~ CmpNat x n, Lookupable' x a ('ForkTree l (Node n a1) r) o) => Lookupable x a ('ForkTree l (Node n a1) r) Source # | |
Defined in Data.Tree.BST.Extern.Lookup | |
class Lookupable' (x :: Nat) (a :: Type) (t :: Tree) (o :: Ordering) where Source #
This type class provides the functionality to lookup a node with key x
in a non empty tree t without checking any structural invariant (key ordering).
It's only used by the Lookupable class and it has one extra parameter o,
which is the type level comparison of x with the key value of the root node.
The o parameter guides the lookup.