HaskellWorks.Data.Aeson
newtype JsonEndo a Source #
Constructors
Fields
Defined in HaskellWorks.Data.Aeson
Methods
(<>) :: JsonEndo a -> JsonEndo a -> JsonEndo a #
sconcat :: NonEmpty (JsonEndo a) -> JsonEndo a #
stimes :: Integral b => b -> JsonEndo a -> JsonEndo a #
mempty :: JsonEndo a #
mappend :: JsonEndo a -> JsonEndo a -> JsonEndo a #
mconcat :: [JsonEndo a] -> JsonEndo a #
(.=) :: ToJSON v => Key -> v -> JsonEndo a #
objectWithoutNulls :: [Pair] -> Value Source #
readJson :: Read a => String -> String -> Parser a Source #
objectEndo :: [JsonEndo Pair] -> Value Source #
Same as object except used in combination with .?= and .!= instead of .=.
object
.?=
.!=
.=
For example:
toJSON o = objectEndo [ "mandatory" .!= o ^. the "mandatory" , "optional" .?= o ^. the "optional" ]
toJSON
objectEndo
^.
"mandatory" , "optional" .?= o ^. the
(.?=) :: (KeyValue p, ToJSON v, Monoid p) => Key -> Maybe v -> p infixr 7 Source #
Render optional fields as missing in JSON output.
(.!=) :: (KeyValue kv, ToJSON v) => Key -> v -> kv infixr 7 Source #
Same as .=, but with lower precedence to work well with lens.