morley-1.12.0: Developer tools for the Michelson Language
Safe HaskellNone
LanguageHaskell2010

Util.Generic

Description

Generic-related utils.

Synopsis

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.