mu-schema-0.3.1.0: Format-independent schemas for serialization

Safe HaskellNone
LanguageHaskell2010

Mu.Schema.Examples

Description

Look at the source code of this module.

Documentation

data Person Source #

Constructors

Person 
Instances
Eq Person Source # 
Instance details

Defined in Mu.Schema.Examples

Methods

(==) :: Person -> Person -> Bool #

(/=) :: Person -> Person -> Bool #

Show Person Source # 
Instance details

Defined in Mu.Schema.Examples

Generic Person Source # 
Instance details

Defined in Mu.Schema.Examples

Associated Types

type Rep Person :: Type -> Type #

Methods

from :: Person -> Rep Person x #

to :: Rep Person x -> Person #

ToJSON Person Source # 
Instance details

Defined in Mu.Schema.Examples

FromJSON Person Source # 
Instance details

Defined in Mu.Schema.Examples

FromSchema ExampleSchema "person" Person Source # 
Instance details

Defined in Mu.Schema.Examples

ToSchema ExampleSchema "person" Person Source # 
Instance details

Defined in Mu.Schema.Examples

type Rep Person Source # 
Instance details

Defined in Mu.Schema.Examples

data Address Source #

Constructors

Address 

Fields

Instances
Eq Address Source # 
Instance details

Defined in Mu.Schema.Examples

Methods

(==) :: Address -> Address -> Bool #

(/=) :: Address -> Address -> Bool #

Show Address Source # 
Instance details

Defined in Mu.Schema.Examples

Generic Address Source # 
Instance details

Defined in Mu.Schema.Examples

Associated Types

type Rep Address :: Type -> Type #

Methods

from :: Address -> Rep Address x #

to :: Rep Address x -> Address #

ToJSON Address Source # 
Instance details

Defined in Mu.Schema.Examples

FromJSON Address Source # 
Instance details

Defined in Mu.Schema.Examples

FromSchema ExampleSchema "address" Address Source # 
Instance details

Defined in Mu.Schema.Examples

ToSchema ExampleSchema "address" Address Source # 
Instance details

Defined in Mu.Schema.Examples

type Rep Address Source # 
Instance details

Defined in Mu.Schema.Examples

type Rep Address = D1 (MetaData "Address" "Mu.Schema.Examples" "mu-schema-0.3.1.0-5m1drucylVX67Vn9gEmaOx" False) (C1 (MetaCons "Address" PrefixI True) (S1 (MetaSel (Just "postcode") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Text) :*: S1 (MetaSel (Just "country") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Text)))

type GenderFieldMapping = '["Male" :-> "male", "Female" :-> "female", "NonBinary" :-> "nb"] Source #

data Gender Source #

Constructors

Male 
Female 
NonBinary 
Instances
Eq Gender Source # 
Instance details

Defined in Mu.Schema.Examples

Methods

(==) :: Gender -> Gender -> Bool #

(/=) :: Gender -> Gender -> Bool #

Show Gender Source # 
Instance details

Defined in Mu.Schema.Examples

Generic Gender Source # 
Instance details

Defined in Mu.Schema.Examples

Associated Types

type Rep Gender :: Type -> Type #

Methods

from :: Gender -> Rep Gender x #

to :: Rep Gender x -> Gender #

ToJSON Gender Source # 
Instance details

Defined in Mu.Schema.Examples

FromJSON Gender Source # 
Instance details

Defined in Mu.Schema.Examples

FromSchema ExampleSchema "gender" Gender Source # 
Instance details

Defined in Mu.Schema.Examples

ToSchema ExampleSchema "gender" Gender Source # 
Instance details

Defined in Mu.Schema.Examples

type Rep Gender Source # 
Instance details

Defined in Mu.Schema.Examples

type Rep Gender = D1 (MetaData "Gender" "Mu.Schema.Examples" "mu-schema-0.3.1.0-5m1drucylVX67Vn9gEmaOx" False) (C1 (MetaCons "Male" PrefixI False) (U1 :: Type -> Type) :+: (C1 (MetaCons "Female" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "NonBinary" PrefixI False) (U1 :: Type -> Type)))

type ExampleSchema = '[DEnum "gender" '[ChoiceDef "male", ChoiceDef "female", ChoiceDef "nb"], DRecord "address" '[FieldDef "postcode" (TPrimitive Text), FieldDef "country" (TPrimitive Text)], DRecord "person" '[FieldDef "firstName" (TPrimitive Text), FieldDef "lastName" (TPrimitive Text), FieldDef "age" (TOption (TPrimitive Int)), FieldDef "gender" (TOption (TSchematic "gender")), FieldDef "address" (TSchematic "address"), FieldDef "lucky_numbers" (TList (TPrimitive Int))]] Source #

data GenderMsg f Source #

Instances
Eq (GenderMsg f) Source # 
Instance details

Defined in Mu.Schema.Examples

Methods

(==) :: GenderMsg f -> GenderMsg f -> Bool #

(/=) :: GenderMsg f -> GenderMsg f -> Bool #

Ord (GenderMsg f) Source # 
Instance details

Defined in Mu.Schema.Examples

Show (GenderMsg f) Source # 
Instance details

Defined in Mu.Schema.Examples

Generic (GenderMsg f) Source # 
Instance details

Defined in Mu.Schema.Examples

Associated Types

type Rep (GenderMsg f) :: Type -> Type #

Methods

from :: GenderMsg f -> Rep (GenderMsg f) x #

to :: Rep (GenderMsg f) x -> GenderMsg f #

type Rep (GenderMsg f) Source # 
Instance details

Defined in Mu.Schema.Examples

type Rep (GenderMsg f) = D1 (MetaData "GenderMsg" "Mu.Schema.Examples" "mu-schema-0.3.1.0-5m1drucylVX67Vn9gEmaOx" False) (C1 (MetaCons "GenderMsgMale" PrefixI False) (U1 :: Type -> Type) :+: (C1 (MetaCons "GenderMsgFemale" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "GenderMsgNb" PrefixI False) (U1 :: Type -> Type)))

data AddressMsg f Source #

Constructors

AddressMsg 
Instances
Generic (AddressMsg f) Source # 
Instance details

Defined in Mu.Schema.Examples

Associated Types

type Rep (AddressMsg f) :: Type -> Type #

Methods

from :: AddressMsg f -> Rep (AddressMsg f) x #

to :: Rep (AddressMsg f) x -> AddressMsg f #

type Rep (AddressMsg f) Source # 
Instance details

Defined in Mu.Schema.Examples

type Rep (AddressMsg f) = D1 (MetaData "AddressMsg" "Mu.Schema.Examples" "mu-schema-0.3.1.0-5m1drucylVX67Vn9gEmaOx" False) (C1 (MetaCons "AddressMsg" PrefixI True) (S1 (MetaSel (Just "addressMsgPostcode") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (f Text)) :*: S1 (MetaSel (Just "addressMsgCountry") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (f Text))))

data PersonMsg f Source #

Instances
Generic (PersonMsg f) Source # 
Instance details

Defined in Mu.Schema.Examples

Associated Types

type Rep (PersonMsg f) :: Type -> Type #

Methods

from :: PersonMsg f -> Rep (PersonMsg f) x #

to :: Rep (PersonMsg f) x -> PersonMsg f #

type Rep (PersonMsg f) Source # 
Instance details

Defined in Mu.Schema.Examples

type Rep (PersonMsg f) = D1 (MetaData "PersonMsg" "Mu.Schema.Examples" "mu-schema-0.3.1.0-5m1drucylVX67Vn9gEmaOx" False) (C1 (MetaCons "PersonMsg" PrefixI True) ((S1 (MetaSel (Just "personMsgFirstName") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (f Text)) :*: (S1 (MetaSel (Just "personMsgLastName") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (f Text)) :*: S1 (MetaSel (Just "personMsgAge") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (f (Maybe Int))))) :*: (S1 (MetaSel (Just "personMsgGender") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (f (Maybe (GenderMsg f)))) :*: (S1 (MetaSel (Just "personMsgAddress") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (f (AddressMsg f))) :*: S1 (MetaSel (Just "personMsgLucky_numbers") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (f [Int]))))))

type ExampleSchema2 = '[DEnum "gender" '[ChoiceDef "Male", ChoiceDef "Female", ChoiceDef "NonBinary"], DRecord "address" '[FieldDef "postcode" (TPrimitive Text), FieldDef "country" (TPrimitive Text)], DRecord "person" '[FieldDef "firstName" (TPrimitive Text), FieldDef "lastName" (TPrimitive Text), FieldDef "age" (TOption (TPrimitive Int)), FieldDef "gender" (TOption (TSchematic "gender")), FieldDef "address" (TSchematic "address")]] Source #