Safe Haskell | None |
---|---|
Language | Haskell2010 |
Generic-related utils.
Synopsis
- mkGenericTree :: (Int -> a -> a -> a) -> NonEmpty a -> a
- mkGenericTreeVec :: HasCallStack => (a -> b) -> (Int -> b -> b -> b) -> Vector a -> b
Documentation
mkGenericTree :: (Int -> a -> a -> a) -> NonEmpty a -> a Source #
Rebuild a list into a binary tree of exactly the same form which
Generic
uses to represent datatypes.
Along with the original list you have to provide constructor for intermediate nodes - it accepts zero-based index of the leftmost element of the right tree and merged trees themselves.
mkGenericTreeVec :: HasCallStack => (a -> b) -> (Int -> b -> b -> b) -> Vector a -> b Source #