json-spec-elm-0.3.0.0: Elm code generate for `json-spec`.
Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.JsonSpec.Elm

Synopsis

Documentation

elmDefs :: forall spec. HasType spec => Proxy (spec :: Specification) -> Set Definition Source #

class HasType (spec :: Specification) where Source #

Instances

Instances details
HasType 'JsonBool Source # 
Instance details

Defined in Data.JsonSpec.Elm

HasType 'JsonDateTime Source # 
Instance details

Defined in Data.JsonSpec.Elm

HasType 'JsonInt Source # 
Instance details

Defined in Data.JsonSpec.Elm

HasType 'JsonNum Source # 
Instance details

Defined in Data.JsonSpec.Elm

HasType 'JsonString Source # 
Instance details

Defined in Data.JsonSpec.Elm

HasType spec => HasType ('JsonArray spec) Source # 
Instance details

Defined in Data.JsonSpec.Elm

HasType spec => HasType ('JsonNullable spec) Source # 
Instance details

Defined in Data.JsonSpec.Elm

Record fields => HasType ('JsonObject fields) Source # 
Instance details

Defined in Data.JsonSpec.Elm

KnownSymbol name => HasType ('JsonRef name) Source # 
Instance details

Defined in Data.JsonSpec.Elm

KnownSymbol const => HasType ('JsonTag const) Source # 
Instance details

Defined in Data.JsonSpec.Elm

(TypeError (((((((((((((((((((((((((('Text "Elm doesn't support anonymous sum types, so if you " ':<>: 'Text "want to use (possibly nested) `JsonEither` ") ':<>: 'Text "you must give it a name using `JsonLet`, e.g:") ':$$: 'Text "") ':$$: 'Text "> JsonLet") ':$$: 'Text "> '[ '( \"MySum\"") ':$$: 'Text "> , JsonEither") ':$$: 'Text "> ( JsonEither") ':$$: 'Text "> JsonInt") ':$$: 'Text "> JsonString") ':$$: 'Text "> )") ':$$: 'Text "> ( JsonEither") ':$$: 'Text "> JsonFloat") ':$$: 'Text "> JsonBool") ':$$: 'Text "> )") ':$$: 'Text "> )") ':$$: 'Text "> ]") ':$$: 'Text "> (JsonRef \"MySum\")") ':$$: 'Text "") ':$$: 'Text "This will produce the Elm type") ':$$: 'Text "") ':$$: 'Text "> type MySum") ':$$: 'Text "> = MySum_1 Int") ':$$: 'Text "> | MySum_2 String") ':$$: 'Text "> | MySum_3 Float") ':$$: 'Text "> | MySum_4 Bool") ':$$: 'Text "") :: Constraint) => HasType ('JsonEither left right) Source # 
Instance details

Defined in Data.JsonSpec.Elm

(HasDef def, HasType ('JsonLet more spec)) => HasType ('JsonLet (def ': more) spec) Source # 
Instance details

Defined in Data.JsonSpec.Elm

HasType spec => HasType ('JsonLet ('[] :: [(Symbol, Specification)]) spec) Source # 
Instance details

Defined in Data.JsonSpec.Elm

type Named name def = JsonLet '['(name, def)] (JsonRef name) Source #

Helper for giving a specification a name. This is especially useful for making sure sum type data constructors have meaningful names.