type-cereal-0.3: 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 :: DigitSource

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_data :: 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).

serializeType_ :: Monad m => (Name -> Type) -> Name -> m [Dec]Source

serializeTypeAsHash_data :: Name -> Q [Dec]Source

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