Safe Haskell | None |
---|---|
Language | Haskell2010 |
BundledPatterns
Documentation
Fixed size vectors.
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 (a :: Nat) b 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:
|