type-cereal-0.1.1: Type-level serialization of type constructors

Portabilitysee LANGUAGE pragmas (... GHC)
Stabilityexperimental
Maintainernicolas.frisby@gmail.com
Safe HaskellNone

Type.Serialize.Base

Description

Type-level serialization (i.e. type -> type-digit type-level numeral).

Synopsis

Documentation

type family Serialize a Source

Serialize maps a type to its unique type-level serialization.

encode :: Serialize a => a -> TypeSource

Encode uses the cereal package serializer to encode the value and then uses type-digits to reflect it as a type-level numeral.

serializeType :: Name -> Q [Dec]Source

Generates the Serialize instance corresponding to the serialization of the type constructor's globally unique name (i.e. TH's NameG).

serializeTypeAsHash :: Name -> Q [Dec]Source

serializeType can result in very large types, so we prefer the data-hash hash of the NameG's serialization.

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

serializeType can result in very large types, so we prefer the data-hash hash of the NameG's serialization.