mu-schema-0.2.0.0: Format-independent schemas for serialization
Safe HaskellNone
LanguageHaskell2010

Mu.Schema.Conversion.TypesToSchema

Description

Obtains a Schema from a set of Haskell types.

Unfortunately, GHC does not allow type families to appear in instances, so you cannot use the resulting type directly. Instead, evaluate it in an interpreter session using :kind! and copy the result to the file.

Synopsis

Documentation

type family SchemaFromTypes (f :: [FromType tn fn]) :: Schema tn fn where ... Source #

Convert a set of types into a Schema.

Equations

SchemaFromTypes f = SchemaFromTypes' f f 

data FromType tn fn Source #

Defines whether to turn each Haskell type into a record or an enumeration. Any type not declared in the given list of FromTypes is considered primitive.

Constructors

AsRecord' Type tn (Mappings Symbol fn)

Declares that the type should become a record.

AsEnum' Type tn (Mappings Symbol fn)

Declares that the type should become an enumeration.

type AsRecord t tn = 'AsRecord' t tn '[] Source #

Declares that the type should become a record.

type AsEnum t tn = 'AsEnum' t tn '[] Source #

Declares that the type should become an enumeration.