Safe Haskell | None |
---|---|
Language | Haskell2010 |
Generic-related utils.
Synopsis
- mkGenericTree :: (Natural -> a -> a -> a) -> NonEmpty a -> a
- mkGenericTreeVec :: HasCallStack => (a -> b) -> (Natural -> b -> b -> b) -> Vector a -> b
- type GenericTypeName a = GTypeName (Rep a)
Documentation
mkGenericTree :: (Natural -> 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) -> (Natural -> b -> b -> b) -> Vector a -> b Source #
type GenericTypeName a = GTypeName (Rep a) Source #
Extract datatype name via its Generic representation.
For polymorphic types this throws away all type arguments.