Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- elmDefs :: forall spec. HasType spec => Proxy (spec :: Specification) -> Set Definition
- type Definitions = Writer (Set Definition)
- class HasType (spec :: Specification) where
- typeOf :: forall v. Definitions (Type v)
- decoderOf :: Definitions (Expression Void)
- encoderOf :: Definitions (Expression Void)
- type Named name def = JsonLet '['(name, def)] (JsonRef name)
Documentation
elmDefs :: forall spec. HasType spec => Proxy (spec :: Specification) -> Set Definition Source #
type Definitions = Writer (Set Definition) Source #
class HasType (spec :: Specification) where Source #
typeOf :: forall v. Definitions (Type v) Source #
Instances
HasType 'JsonBool Source # | |
Defined in Data.JsonSpec.Elm typeOf :: Definitions (Type v) Source # | |
HasType 'JsonDateTime Source # | |
Defined in Data.JsonSpec.Elm typeOf :: Definitions (Type v) Source # | |
HasType 'JsonInt Source # | |
Defined in Data.JsonSpec.Elm typeOf :: Definitions (Type v) Source # | |
HasType 'JsonNum Source # | |
Defined in Data.JsonSpec.Elm typeOf :: Definitions (Type v) Source # | |
HasType 'JsonString Source # | |
Defined in Data.JsonSpec.Elm typeOf :: Definitions (Type v) Source # | |
HasType spec => HasType ('JsonArray spec) Source # | |
Defined in Data.JsonSpec.Elm typeOf :: Definitions (Type v) Source # | |
HasType spec => HasType ('JsonNullable spec) Source # | |
Defined in Data.JsonSpec.Elm typeOf :: Definitions (Type v) Source # | |
Record fields => HasType ('JsonObject fields) Source # | |
Defined in Data.JsonSpec.Elm typeOf :: Definitions (Type v) Source # | |
KnownSymbol name => HasType ('JsonRef name) Source # | |
Defined in Data.JsonSpec.Elm typeOf :: Definitions (Type v) Source # | |
KnownSymbol const => HasType ('JsonTag const) Source # | |
Defined in Data.JsonSpec.Elm typeOf :: Definitions (Type v) Source # | |
(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 # | |
Defined in Data.JsonSpec.Elm typeOf :: Definitions (Type v) Source # | |
(HasDef def, HasType ('JsonLet more spec)) => HasType ('JsonLet (def ': more) spec) Source # | |
Defined in Data.JsonSpec.Elm typeOf :: Definitions (Type v) Source # | |
HasType spec => HasType ('JsonLet ('[] :: [(Symbol, Specification)]) spec) Source # | |
Defined in Data.JsonSpec.Elm typeOf :: Definitions (Type v) Source # |