Module
Simple.JSON
- Package
- purescript-simple-json
- Repository
- justinwoo/purescript-simple-json
#E Source
type E a = Either MultipleErrors aAn alias for the Either result of decoding
#readJSON Source
readJSON :: forall a. ReadForeign a => String -> E aRead a JSON string to a type a while returning a MultipleErrors if the
parsing failed.
#readJSON' Source
readJSON' :: forall a. ReadForeign a => String -> F aRead a JSON string to a type a using F a. Useful with record types.
#readJSON_ Source
readJSON_ :: forall a. ReadForeign a => String -> Maybe aRead a JSON string to a type a while returning Nothing if the parsing
failed.
#writeJSON Source
writeJSON :: forall a. WriteForeign a => a -> StringWrite a JSON string from a type a.
#write Source
write :: forall a. WriteForeign a => a -> Foreign#read_ Source
read_ :: forall a. ReadForeign a => Foreign -> Maybe aRead a Foreign value to a type, as a Maybe of type
#ReadForeign Source
class ReadForeign a whereA class for reading foreign values to a type
Members
Instances
ReadForeign ForeignReadForeign CharReadForeign NumberReadForeign IntReadForeign StringReadForeign Boolean(ReadForeign a) => ReadForeign (Array a)(ReadForeign a) => ReadForeign (Maybe a)(ReadForeign a) => ReadForeign (Nullable a)(ReadForeign a) => ReadForeign (Object a)(RowToList fields fieldList, ReadForeignFields fieldList () fields) => ReadForeign (Record fields)(RowToList variants rl, ReadForeignVariant rl variants) => ReadForeign (Variant variants)
#ReadForeignFields Source
class ReadForeignFields (xs :: RowList) (from :: Row Type) (to :: Row Type) | xs -> from to whereA class for reading foreign values from properties
Members
Instances
(IsSymbol name, ReadForeign ty, ReadForeignFields tail from from', Lacks name from', Cons name ty from' to) => ReadForeignFields (Cons name ty tail) from toReadForeignFields Nil () ()
#ReadForeignVariant Source
class ReadForeignVariant (xs :: RowList) (row :: Row Type) | xs -> row whereMembers
readVariantImpl :: RLProxy xs -> Foreign -> F (Variant row)
Instances
ReadForeignVariant Nil trash(IsSymbol name, ReadForeign ty, Cons name ty trash row, ReadForeignVariant tail row) => ReadForeignVariant (Cons name ty tail) row
#WriteForeign Source
class WriteForeign a whereMembers
Instances
WriteForeign ForeignWriteForeign StringWriteForeign IntWriteForeign CharWriteForeign NumberWriteForeign Boolean(WriteForeign a) => WriteForeign (Array a)(WriteForeign a) => WriteForeign (Maybe a)(WriteForeign a) => WriteForeign (Nullable a)(WriteForeign a) => WriteForeign (Object a)(RowToList row rl, WriteForeignFields rl row () to) => WriteForeign (Record row)(RowToList row rl, WriteForeignVariant rl row) => WriteForeign (Variant row)
#WriteForeignFields Source
class WriteForeignFields (rl :: RowList) row (from :: Row Type) (to :: Row Type) | rl -> row from to whereMembers
writeImplFields :: forall g. g rl -> Record row -> Builder (Record from) (Record to)
Instances
(IsSymbol name, WriteForeign ty, WriteForeignFields tail row from from', Cons name ty whatever row, Lacks name from', Cons name Foreign from' to) => WriteForeignFields (Cons name ty tail) row from toWriteForeignFields Nil row () ()
#WriteForeignVariant Source
class WriteForeignVariant (rl :: RowList) (row :: Row Type) | rl -> row whereMembers
writeVariantImpl :: forall g. g rl -> Variant row -> Foreign
Instances
WriteForeignVariant Nil ()(IsSymbol name, WriteForeign ty, Cons name ty subRow row, WriteForeignVariant tail subRow) => WriteForeignVariant (Cons name ty tail) row
- Modules
- Simple.
JSON