Interface and utilities for encoding Idris2 values to JSON via an entermediate `Value` representation. For regular algebraic data types, implementations can automatically be derived using elaborator reflection (see module `Derive.ToJSON`) Operators and functionality strongly influenced by Haskell's aeson library
interface ToJSON : Type -> TypeToJSON VoidToJSON StringToJSON CharToJSON DoubleToJSON Bits8ToJSON Bits16ToJSON Bits32ToJSON Bits64ToJSON Int8ToJSON Int16ToJSON Int32ToJSON Int64ToJSON IntToJSON IntegerToJSON NatToJSON BoolToJSON a => ToJSON (Maybe a)ToJSON a => ToJSON (List a)ToJSON a => ToJSON (SnocList a)ToJSON a => ToJSON (List1 a)ToJSON a => ToJSON (Vect n a)ToJSON ()ToJSON a => ToJSON b => ToJSON (Either a b)ToJSON a => ToJSON b => ToJSON (a, b)ToJSON a => ToJSON (SortedMap String a)All (ToJSON . f) ts => ToJSON (All f ts)All (ToJSON . f) ts => ToJSON (All f ts)toJSON : ToJSON a => Encoder v => a -> vjpair : ToJSON a => Encoder v => String -> a -> (String, v)(.=) : ToJSON a => Encoder v => String -> a -> (String, v)Deprecated: Use `jpair` instead
encodeVia : (0 v : Type) -> Encoder v => ToJSON a => a -> Stringencode : ToJSON a => a -> StringsingleField : Encoder v => String -> v -> vEncodes a value as a single-field object. The field has the given
name.
This corresponds to the `ObjectWithSingleField` option
for encoding sum types.
twoElemArray : Encoder v => String -> v -> vEncodes a value plus a string as a two-element array.
This corresponds to the `TwoElemArray` option
for encoding sum types.
taggedObject : Encoder v => String -> String -> String -> v -> vEncodes a value plus a string as a tagged object.
This corresponds to the `TaggedObject` option
for encoding sum types.
zipAllWith : ((x `p`) -> q x -> r x) -> All p xs -> All q xs -> All r xs