| 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.AVL.Intern.Lookup
Description
Implementation of the lookup algorithm over internalist AVL trees. Since the lookup does not modify the tree, there is no need for proofs.
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 AVL t.
The lookup is defined at the value level and the type level.
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 -> AVL t -> a Source #
Instances
| (t ~ 'ForkTree l (Node n a1) r, a ~ LookupValueType x t t, Lookupable' x a t (CmpNat x n)) => Lookupable x a ('ForkTree l (Node n a1) r) Source # | |
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 AVL t.
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.