| 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.Intern.Constructors
Description
Implementation of the constructor of type safe internalist BST
trees and instance definition for the Show type class.
Documentation
data BST :: Tree -> Type where Source #
Constructor of internalist BST trees.
Given two BST 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.
Notice that this is all that's needed to assert that the new tree is a BST,
since, by recursive logic, both left and right BST trees already respect the key ordering.