| Safe Haskell | None |
|---|
BundledPatterns
Documentation
data Vec :: Nat -> * -> * where #
Fixed size vectors.
- Lists with their length encoded in their type
Vector elements have an ASCENDING subscript starting from 0 and ending at.length- 1
Bundled Patterns
| pattern (:>) :: a -> Vec n a -> Vec (n + 1) a infixr 5 | Add an element to the head of a vector.
Can be used as a pattern:
Also in conjunctions with (
|
data RTree :: Nat -> * -> * where #
Perfect depth binary tree.
- Only has elements at the leaf of the tree
- A tree of depth d has 2^d elements.
Bundled Patterns
| pattern LR :: a -> RTree 0 a | Leaf of a perfect depth tree
Can be used as a pattern:
|
| pattern BR :: RTree d a -> RTree d a -> RTree (d + 1) a | Branch of a perfect depth tree
Case be used a pattern:
|