Copyright | (c) Nicolás Rodríguez 2021 |
---|---|
License | GPL-3 |
Maintainer | Nicolás Rodríguez |
Stability | experimental |
Portability | POSIX |
Safe Haskell | Safe |
Language | Haskell2010 |
Implementation of the constructor of type safe internalist AVL
trees and instance definition for the Show
type class.
Documentation
data AVL :: Tree -> Type where Source #
Constructor of AVL
trees. Given two AVL
trees and an arbitrary node,
it tests at compile time wether the key of the node verifies the LtN
and GtN
invariants
with respect to each tree and if the heights are balanced.
Notice that, by inductive reasoning, this is all that's needed to assert that the new tree is a AVL
.