mu-schema 0.3.1.1 → 0.3.1.2
raw patch · 3 files changed
+11/−8 lines, 3 filesdep ~template-haskelldep ~th-abstractionsetup-changedPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
Dependency ranges changed: template-haskell, th-abstraction
API changes (from Hackage documentation)
+ Mu.Schema.Examples: [personMsgThings] :: PersonMsg f_azCP -> f_azCP (Map Text Int)
+ Mu.Schema.Examples: [things] :: Person -> Map Text Int
- Mu.Schema.Examples: AddressMsg :: f_ayDE Text -> f_ayDE Text -> AddressMsg f_ayDE
+ Mu.Schema.Examples: AddressMsg :: f_azCN Text -> f_azCN Text -> AddressMsg f_azCN
- Mu.Schema.Examples: GenderMsgFemale :: GenderMsg f_ayDC
+ Mu.Schema.Examples: GenderMsgFemale :: GenderMsg f_azCL
- Mu.Schema.Examples: GenderMsgGender0 :: GenderMsg f_ayDC
+ Mu.Schema.Examples: GenderMsgGender0 :: GenderMsg f_azCL
- Mu.Schema.Examples: GenderMsgGender1 :: GenderMsg f_ayDC
+ Mu.Schema.Examples: GenderMsgGender1 :: GenderMsg f_azCL
- Mu.Schema.Examples: GenderMsgGender2 :: GenderMsg f_ayDC
+ Mu.Schema.Examples: GenderMsgGender2 :: GenderMsg f_azCL
- Mu.Schema.Examples: GenderMsgGender3 :: GenderMsg f_ayDC
+ Mu.Schema.Examples: GenderMsgGender3 :: GenderMsg f_azCL
- Mu.Schema.Examples: GenderMsgGender4 :: GenderMsg f_ayDC
+ Mu.Schema.Examples: GenderMsgGender4 :: GenderMsg f_azCL
- Mu.Schema.Examples: GenderMsgGender5 :: GenderMsg f_ayDC
+ Mu.Schema.Examples: GenderMsgGender5 :: GenderMsg f_azCL
- Mu.Schema.Examples: GenderMsgGender6 :: GenderMsg f_ayDC
+ Mu.Schema.Examples: GenderMsgGender6 :: GenderMsg f_azCL
- Mu.Schema.Examples: GenderMsgGender7 :: GenderMsg f_ayDC
+ Mu.Schema.Examples: GenderMsgGender7 :: GenderMsg f_azCL
- Mu.Schema.Examples: GenderMsgGender8 :: GenderMsg f_ayDC
+ Mu.Schema.Examples: GenderMsgGender8 :: GenderMsg f_azCL
- Mu.Schema.Examples: GenderMsgGender9 :: GenderMsg f_ayDC
+ Mu.Schema.Examples: GenderMsgGender9 :: GenderMsg f_azCL
- Mu.Schema.Examples: GenderMsgMale :: GenderMsg f_ayDC
+ Mu.Schema.Examples: GenderMsgMale :: GenderMsg f_azCL
- Mu.Schema.Examples: GenderMsgNb :: GenderMsg f_ayDC
+ Mu.Schema.Examples: GenderMsgNb :: GenderMsg f_azCL
- Mu.Schema.Examples: GenderMsgUnspecified :: GenderMsg f_ayDC
+ Mu.Schema.Examples: GenderMsgUnspecified :: GenderMsg f_azCL
- Mu.Schema.Examples: Person :: Text -> Text -> Maybe Int -> Maybe Gender -> Address -> [Int] -> Person
+ Mu.Schema.Examples: Person :: Text -> Text -> Maybe Int -> Gender -> Address -> [Int] -> Map Text Int -> Person
- Mu.Schema.Examples: PersonMsg :: f_ayDG Text -> f_ayDG Text -> f_ayDG (Maybe Int) -> f_ayDG (Maybe (GenderMsg f_ayDG)) -> f_ayDG (AddressMsg f_ayDG) -> f_ayDG [Int] -> PersonMsg f_ayDG
+ Mu.Schema.Examples: PersonMsg :: f_azCP Text -> f_azCP Text -> f_azCP (Maybe Int) -> f_azCP (GenderMsg f_azCP) -> f_azCP (AddressMsg f_azCP) -> f_azCP [Int] -> f_azCP (Map Text Int) -> PersonMsg f_azCP
- Mu.Schema.Examples: [addressMsgCountry] :: AddressMsg f_ayDE -> f_ayDE Text
+ Mu.Schema.Examples: [addressMsgCountry] :: AddressMsg f_azCN -> f_azCN Text
- Mu.Schema.Examples: [addressMsgPostcode] :: AddressMsg f_ayDE -> f_ayDE Text
+ Mu.Schema.Examples: [addressMsgPostcode] :: AddressMsg f_azCN -> f_azCN Text
- Mu.Schema.Examples: [gender] :: Person -> Maybe Gender
+ Mu.Schema.Examples: [gender] :: Person -> Gender
- Mu.Schema.Examples: [personMsgAddress] :: PersonMsg f_ayDG -> f_ayDG (AddressMsg f_ayDG)
+ Mu.Schema.Examples: [personMsgAddress] :: PersonMsg f_azCP -> f_azCP (AddressMsg f_azCP)
- Mu.Schema.Examples: [personMsgAge] :: PersonMsg f_ayDG -> f_ayDG (Maybe Int)
+ Mu.Schema.Examples: [personMsgAge] :: PersonMsg f_azCP -> f_azCP (Maybe Int)
- Mu.Schema.Examples: [personMsgFirstName] :: PersonMsg f_ayDG -> f_ayDG Text
+ Mu.Schema.Examples: [personMsgFirstName] :: PersonMsg f_azCP -> f_azCP Text
- Mu.Schema.Examples: [personMsgGender] :: PersonMsg f_ayDG -> f_ayDG (Maybe (GenderMsg f_ayDG))
+ Mu.Schema.Examples: [personMsgGender] :: PersonMsg f_azCP -> f_azCP (GenderMsg f_azCP)
- Mu.Schema.Examples: [personMsgLastName] :: PersonMsg f_ayDG -> f_ayDG Text
+ Mu.Schema.Examples: [personMsgLastName] :: PersonMsg f_azCP -> f_azCP Text
- Mu.Schema.Examples: [personMsgLucky_numbers] :: PersonMsg f_ayDG -> f_ayDG [Int]
+ Mu.Schema.Examples: [personMsgLucky_numbers] :: PersonMsg f_azCP -> f_azCP [Int]
- Mu.Schema.Examples: data AddressMsg f_ayDE
+ Mu.Schema.Examples: data AddressMsg f_azCN
- Mu.Schema.Examples: data GenderMsg f_ayDC
+ Mu.Schema.Examples: data GenderMsg f_azCL
- Mu.Schema.Examples: data PersonMsg f_ayDG
+ Mu.Schema.Examples: data PersonMsg f_azCP
- Mu.Schema.Examples: 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" ('TOption ('TSchematic "gender")), 'FieldDef "address" ('TSchematic "address"), 'FieldDef "lucky_numbers" ('TList ('TPrimitive Int))]]
+ Mu.Schema.Examples: 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))]]
Files
- Setup.hs +1/−1
- mu-schema.cabal +3/−3
- src/Mu/Schema/Examples.hs +7/−4
Setup.hs view
@@ -1,2 +1,2 @@-import Distribution.Simple+import Distribution.Simple main = defaultMain
mu-schema.cabal view
@@ -1,5 +1,5 @@ name: mu-schema-version: 0.3.1.1+version: 0.3.1.2 synopsis: Format-independent schemas for serialization description: With @mu-schema@ you can describe schemas using type-level constructs, and derive serializers from those. See @mu-avro@, @mu-protobuf@ for the actual adapters.@@ -44,9 +44,9 @@ , containers >=0.6 && <0.7 , first-class-families >=0.8 && <0.9 , sop-core >=0.5 && <0.6- , template-haskell >=2.14 && <2.16+ , template-haskell >=2.14 && <2.17 , text >=1.2 && <2- , th-abstraction >=0.3.2 && <0.4+ , th-abstraction >=0.3.2 && <0.5 , unordered-containers >=0.2 && <0.3 , uuid >=1.3 && <2 , vector >=0.12 && <0.13
src/Mu/Schema/Examples.hs view
@@ -21,6 +21,7 @@ module Mu.Schema.Examples where import qualified Data.Aeson as J+import qualified Data.Map as M import qualified Data.Text as T import GHC.Generics @@ -32,9 +33,10 @@ = Person { firstName :: T.Text , lastName :: T.Text , age :: Maybe Int- , gender :: Maybe Gender+ , gender :: Gender , address :: Address- , lucky_numbers :: [Int] }+ , lucky_numbers :: [Int]+ , things :: M.Map T.Text Int } deriving (Eq, Show, Generic) deriving (ToSchema ExampleSchema "person", FromSchema ExampleSchema "person") deriving (J.ToJSON, J.FromJSON)@@ -109,9 +111,10 @@ '[ 'FieldDef "firstName" ('TPrimitive T.Text) , 'FieldDef "lastName" ('TPrimitive T.Text) , 'FieldDef "age" ('TOption ('TPrimitive Int))- , 'FieldDef "gender" ('TOption ('TSchematic "gender"))+ , 'FieldDef "gender" ('TSchematic "gender") , 'FieldDef "address" ('TSchematic "address")- , 'FieldDef "lucky_numbers" ('TList ('TPrimitive Int)) ]+ , 'FieldDef "lucky_numbers" ('TList ('TPrimitive Int))+ , 'FieldDef "things" ('TMap ('TPrimitive T.Text) ('TPrimitive Int)) ] ] $(generateTypesFromSchema (++"Msg") ''ExampleSchema)