type-spine-0.1.2: A spine-view on types

Portabilitysee LANGUAGE pragmas (... GHC)
Safe HaskellNone



Declares the type wrappers (mappings k -> *) for allKinds and then defines functions for referencing them. Also provides a Template Haskell function for generating the Spine type instances for user-defined datatypes.



type family Spine t Source

The Spine type family represents its argument as either a TypeName or an application via :@.

data TypeName x Source

TypeName represents an occurrence of totally unapplied type name.

data KS t Source

data KTSS t Source

data KTTSSS t Source

data KTSTSS t Source

kNameG :: Kind -> Q NameSource

kNameG k returns the globally unique name (i.e. TH's NameG) of the declared wrapper for types of kind k.

kTypeG :: Kind -> Q TypeSource

kTypeG = conT <=< kNameG.

spineType :: Name -> Q [Dec]Source

spineType n generates the Spine instance for the type named n.

spineType_ :: Name -> [Kind] -> Kind -> Q [Dec]Source

spineType_ n ks k generates the Spine instance for the type named n with parameter kind ks and range kind k.