mu-schema-0.3.1.2: 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

Instances details
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

Instances details
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.2-4fpQREkP1R0LlTmIU6wczZ" '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", "Gender0" :-> "gender0", "Gender1" :-> "gender1", "Gender2" :-> "gender2", "Gender3" :-> "gender3", "Gender4" :-> "gender4", "Gender5" :-> "gender5", "Gender6" :-> "gender6", "Gender7" :-> "gender7", "Gender8" :-> "gender8", "Gender9" :-> "gender9", "Unspecified" :-> "unspecified"] Source #

data Gender Source #

Instances

Instances details
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.2-4fpQREkP1R0LlTmIU6wczZ" '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))) :+: ((C1 ('MetaCons "Gender0" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Gender1" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "Gender2" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Gender3" 'PrefixI 'False) (U1 :: Type -> Type)))) :+: ((C1 ('MetaCons "Gender4" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "Gender5" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Gender6" 'PrefixI 'False) (U1 :: Type -> Type))) :+: ((C1 ('MetaCons "Gender7" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Gender8" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "Gender9" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Unspecified" 'PrefixI 'False) (U1 :: Type -> Type)))))

type ExampleSchema = '['DEnum "gender" '['ChoiceDef "male", 'ChoiceDef "female", 'ChoiceDef "nb", 'ChoiceDef "gender0", 'ChoiceDef "gender1", 'ChoiceDef "gender2", 'ChoiceDef "gender3", 'ChoiceDef "gender4", 'ChoiceDef "gender5", 'ChoiceDef "gender6", 'ChoiceDef "gender7", 'ChoiceDef "gender8", 'ChoiceDef "gender9", 'ChoiceDef "unspecified"], '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" ('TSchematic "gender"), 'FieldDef "address" ('TSchematic "address"), 'FieldDef "lucky_numbers" ('TList ('TPrimitive Int)), 'FieldDef "things" ('TMap ('TPrimitive Text) ('TPrimitive Int))]] Source #

data GenderMsg f Source #

Instances

Instances details
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.2-4fpQREkP1R0LlTmIU6wczZ" '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))) :+: ((C1 ('MetaCons "GenderMsgGender0" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "GenderMsgGender1" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "GenderMsgGender2" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "GenderMsgGender3" 'PrefixI 'False) (U1 :: Type -> Type)))) :+: ((C1 ('MetaCons "GenderMsgGender4" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "GenderMsgGender5" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "GenderMsgGender6" 'PrefixI 'False) (U1 :: Type -> Type))) :+: ((C1 ('MetaCons "GenderMsgGender7" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "GenderMsgGender8" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "GenderMsgGender9" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "GenderMsgUnspecified" 'PrefixI 'False) (U1 :: Type -> Type)))))

data AddressMsg f Source #

Constructors

AddressMsg 

Instances

Instances details
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.2-4fpQREkP1R0LlTmIU6wczZ" '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

Instances details
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.2-4fpQREkP1R0LlTmIU6wczZ" '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 (GenderMsg f))) :*: S1 ('MetaSel ('Just "personMsgAddress") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (f (AddressMsg f)))) :*: (S1 ('MetaSel ('Just "personMsgLucky_numbers") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (f [Int])) :*: S1 ('MetaSel ('Just "personMsgThings") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (f (Map Text 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 #