h,$#"      !0.2.2.0 Safe-Inferred 1 json-spec.Structural representation of an object field.  json-specStructural representation of ". (I.e. a constant string value.)  json-spec)This allows for recursive specifications.Since the specification is at the type level, and type level haskell is strict, specifying a recursive definition the "naive" way would cause an infinitely sized type.For example this won't work: data Foo = Foo [Foo] instance HasJsonEncodingSpec Foo where type EncodingSpec Foo = JsonArray (EncodingSpec Foo) toJSONStructure = ... can't be writtenUsing  prevents the specification type from being infinitely sized, but what about "structure" type which holds real values corresponding to the spec? The structure type has to have some way to reference itself or else it too would be infinitely sized.In order to "reference itself" the structure type has to go through a newtype somewhere along the way, and that's what this type is for. Whenever the structure type for your spec requires a self-reference, it will require you to wrap the recursed upon values in this type. For example: data Foo = Foo [Foo] instance HasJsonEncodingSpec Foo where type EncodingSpec Foo = JsonLet '[ '("Foo", JsonArray (JsonRef "Foo")) ] (JsonRef "Foo") toJSONStructure (Foo fs) = [ Rec (toJSONStructure f) | f <- fs ] json-spec spec is the Haskell type used to contain the JSON data that will be encoded or decoded according to the provided spec.Basically, we represent JSON objects as "list-like" nested tuples of the form: (Field @key1 valueType, (Field @key2 valueType, (Field @key3 valueType, ())))7Arrays, booleans, numbers, and strings are just Lists, "s, #s, and $s respectively.If the user can convert their normal business logic type to/from this tuple type, then they get a JSON encoding to/from their type that is guaranteed to be compliant with the  json-specSimple DSL for defining type level "specifications" for JSON data. Similar in spirit to (but not isomorphic with) JSON Schema.,Intended to be used at the type level using  -XDataKindsSee 0 for how these map into Haskell representations.  json-specAn object with the specified properties, each having its own specification. This does not yet support optional properties, although a property can be specified as "nullable" using   json-specAn arbitrary JSON string.  json-spec+An arbitrary (floating point) JSON number.  json-specA JSON integer.  json-spec8A JSON array of values which conform to the given spec.  json-specA JSON boolean value.  json-specA value that can either be %8, or else a value conforming to the specification.E.g.: type SpecWithNullableField = JsonObject '[ '("nullableProperty", JsonNullable JsonString) ] json-specOne of two different specifications. Corresponds to json-schema "oneOf". Useful for encoding sum types. E.g: data MyType = Foo Text | Bar Int | Baz UTCTime instance HasJsonEncodingSpec MyType where type EncodingSpec MyType = JsonEither ( JsonObject '[ '("tag", JsonTag "foo") , '("content", JsonString) ] ) ( JsonEither ( JsonObject '[ '("tag", JsonTag "bar") , '("content", JsonInt) ] ) ( JsonObject '[ '("tag", JsonTag "baz") , '("content", JsonDateTime) ] ) ) json-specA constant string value  json-specA JSON string formatted as an ISO-8601 string. In Haskell this corresponds to , and in json-schema it corresponds to the "date-time" format. json-specA "let" expression. This is useful for giving names to types, which can then be used in the generated code.This is also useful to shorten repetitive type definitions. For example, this repetitive definition: type Triangle = JsonObject '[ '("vertex1", JsonObject '[('x', JsonInt), ('y', JsonInt), ('z', JsonInt)]) , '("vertex2", JsonObject '[('x', JsonInt), ('y', JsonInt), ('z', JsonInt)]) , '("vertex3", JsonObject '[('x', JsonInt), ('y', JsonInt), ('z', JsonInt)]) ]!Can be written more concisely as: type Triangle = JsonLet '[("Vertex", JsonObject '[('x', JsonInt), ('y', JsonInt), ('z', JsonInt)]) ] (JsonObject '[ '("vertex1", JsonRef "Vertex") , '("vertex2", JsonRef "Vertex") , '("vertex3", JsonRef "Vertex") ]))Another use is to define recursive types: type LabelledTree = JsonLet '[ '("LabelledTree", JsonObject '[ '("label", JsonString) , '("children", JsonArray (JsonRef "LabelledTree")) ]) ] (JsonRef "LabelledTree") json-specA reference to a specification which has been defined in a surrounding .& json-specShorthand for demoting type-level strings. Use with -XTypeApplication, e.g.:This function doesn't really "go" in this module, it is only here because this module happens to be at the bottom of the dependency tree and so it is easy to stuff "reusable" things here, and I don't feel like creating a whole new module just for this function (although maybe I should). sym @var&'    None1( json-specThis class is to help )> recursively encode objects, and is mutually recursive with ). If we tried to "recurse on the rest of the object" directly in )4 we would end up with a partial function, because * returns a + not an ,.. We would therefore have to pattern match on + to get the ,% back out, but we would have to call error if the + mysteriously somehow wasn't an , after all. Instead of calling error because "it can't ever happen", we use this helper so the compiler can prove it never happens.) json-spec This is like -, but specialized for our custom "json representation" types (i.e. the  type family). It is also closed (i.e. not exported, so the user can't add instances), because our json representation is closed.see StructureFromJSON3 for an explaination about why we don't just use -. json-specTypes of this class can be encoded to JSON according to a type-level . json-specThe encoding specification.  json-specEncode the value into the structure appropriate for the specification. )*None 1! json-spec Analog of  , but specialized for decoding our "json representations", and closed to the user because the haskell representation scheme is fixed and not extensible by the user.We can't just use   because the types we are using to represent "json data" (i.e. the  type family) already have ToJSON instances. Even if we were to make a bunch of newtypes or whatever to act as the json representation (and therefor also force the user to do a lot of wrapping and unwrapping), that still wouldn't be sufficient because someone could always write an overlapping (or incoherent) ToJSON instance of our newtype! This way we don't have to worry about any of that, and the types that the user must deal with when implementing  fromJSONRepr can be simple tuples and such. json-specTypes of this class can be JSON decoded according to a type-level . json-spec The decoding .  json-specGiven the structural encoding of the JSON data, parse the structure into the final type. The reason this returns a . a instead of just a plain a is because there may still be some invariants of the JSON data that the  language is not able to express, and so you may need to fail parsing in those cases. For instance,  is not powerful enough to express "this field must contain only prime numbers". json-specDirectly decode some JSON accoring to a spec without going through any To/FromJSON instances./None#G json-specHelper for defining - and 0 instances based on HasEncodingJsonSpec.Use with -XDerivingVia like: data MyObj = MyObj { foo :: Int , bar :: Text } deriving (ToJSON, FromJSON) via (SpecJSON MyObj) instance HasEncodingSpec MyObj where ... instance HasDecodingSpec MyObj where ...          1        !"#$$$%&'()*+,-./0123456789:;9:<9=>9:?@9A json-spec-0.2.2.0-inplace Data.JsonSpec json-specData.JsonSpec.Spec Data.TimeUTCTimeData.JsonSpec.EncodeData.JsonSpec.Decode Data.AesonFromJSONFieldTagRecunRec JSONStructure Specification JsonObject JsonStringJsonNumJsonInt JsonArrayJsonBool JsonNullable JsonEitherJsonTag JsonDateTimeJsonLetJsonRefHasJsonEncodingSpec EncodingSpectoJSONStructureStructureFromJSONHasJsonDecodingSpec DecodingSpecfromJSONStructure eitherDecodeSpecJSON unSpecJson$fFromJSONSpecJSON$fToJSONSpecJSONghc-prim GHC.TypesBoolscientific-0.3.7.0-f7f9c313110495a7b682bf00944941835f9c6a45388bbbe8a4413a7ab42706fcData.Scientific Scientifictext-2.1-b46167cae90a5453a5fb34d8f1ab7c3a1a69bb6537337a73172354bbfedd91f9Data.Text.InternalTextbase Data.FoldablenullsymJStruct ToJSONObjectStructureToJSON reprToJSONaeson-2.2.1.0-28620c67d72adb28aa7ea2f7497d26709222ac65f0e7716b1c5cabd4f4d49970Data.Aeson.Types.InternalValueObjectData.Aeson.Types.ToJSONToJSONParser reprParseJSONData.Aeson.Types.FromJSON