Safe Haskell | None |
---|---|
Language | Haskell98 |
Descriptive.JSON
Contents
Description
A JSON API which describes itself.
- object :: Text -> Consumer Object Doc a -> Consumer Value Doc a
- key :: Text -> Consumer Value Doc a -> Consumer Object Doc a
- keyMaybe :: Text -> Consumer Value Doc a -> Consumer Object Doc (Maybe a)
- array :: Text -> Consumer Value Doc a -> Consumer Value Doc (Vector a)
- string :: Text -> Consumer Value Doc Text
- integer :: Text -> Consumer Value Doc Integer
- double :: Text -> Consumer Value Doc Double
- bool :: Text -> Consumer Value Doc Bool
- null :: Text -> Consumer Value Doc ()
- label :: Text -> Consumer s Doc a -> Consumer s Doc a
- data Doc
Combinators
Arguments
:: Text | Description of what the object is. |
-> Consumer Object Doc a | An object consumer. |
-> Consumer Value Doc a |
Consume an object.
Arguments
:: Text | The key to lookup. |
-> Consumer Value Doc a | A value consumer of the object at the key. |
-> Consumer Object Doc a |
Consume from object at the given key.
Arguments
:: Text | The key to lookup. |
-> Consumer Value Doc a | A value consumer of the object at the key. |
-> Consumer Object Doc (Maybe a) |
Optionally consume from object at the given key, only if it exists.
Arguments
:: Text | Description of this array. |
-> Consumer Value Doc a | Consumer for each element in the array. |
-> Consumer Value Doc (Vector a) |
Consume an array.
Consume a string.
Consume an integer.
Consume an double.
Parse a boolean.
Wrap a consumer with a label containing additional description.