- liftAeson :: (FromJSON a, ToJSON a) => Iso (Value :- t) (a :- t)
- option :: Iso (Value :- t) (a :- t) -> Iso (Value :- t) (Maybe a :- t)
- greedyOption :: Iso (Value :- t) (a :- t) -> Iso (Value :- t) (Maybe a :- t)
- array :: Iso (Value :- t) (a :- t) -> Iso (Value :- t) ([a] :- t)
- propBy :: Iso (Value :- t) (a :- t) -> String -> Iso (Object :- t) (Object :- (a :- t))
- rawFixedProp :: String -> Value -> Iso (Object :- t) (Object :- t)
- rest :: Iso (Object :- t) (Object :- (Map Text Value :- t))
- ignoreRest :: Iso (Object :- t) (Object :- t)
- object :: Iso (Object :- t1) (Object :- t2) -> Iso (Value :- t1) t2
- class Json a where
- fromJson :: Json a => Value -> Maybe a
- toJson :: Json a => a -> Maybe Value
- litJson :: Json a => a -> Iso (Value :- t) t
- prop :: Json a => String -> Iso (Object :- t) (Object :- (a :- t))
- fixedProp :: Json a => String -> a -> Iso (Object :- t) (Object :- t)
Constructing JSON grammars
liftAeson :: (FromJSON a, ToJSON a) => Iso (Value :- t) (a :- t)Source
Convert any Aeson-enabled type to a grammar.
array :: Iso (Value :- t) (a :- t) -> Iso (Value :- t) ([a] :- t)Source
Describe an array whose elements match the given grammar.
propBy :: Iso (Value :- t) (a :- t) -> String -> Iso (Object :- t) (Object :- (a :- t))Source
Describe a property with the given name and value grammar.
rawFixedProp :: String -> Value -> Iso (Object :- t) (Object :- t)Source
Expect a specific key/value pair.
rest :: Iso (Object :- t) (Object :- (Map Text Value :- t))Source
Collect all properties left in an object.
ignoreRest :: Iso (Object :- t) (Object :- t)Source
Match and discard all properties left in the object. When converting back to JSON, produces no properties.
object :: Iso (Object :- t1) (Object :- t2) -> Iso (Value :- t1) t2Source
Wrap an exhaustive bunch of properties in an object. Typical usage:
object (prop "key1" . prop "key2")
Type-directed conversion
Convert values of a type to and from JSON.