Module
Data.Foreign.Generic
- Package
- purescript-foreign-generic
- Repository
- paf31/purescript-foreign-generic
#defaultOptions Source
defaultOptions :: OptionsDefault decoding/encoding options:
- Represent sum types as records with
tagandcontentsfields - Unwrap single arguments
- Don't unwrap single constructors
- Use the constructor names as-is
- Use the field names as-is
#genericDecode Source
genericDecode :: forall rep a. Generic a rep => GenericDecode rep => Options -> Foreign -> F aRead a value which has a Generic type.
#genericEncode Source
genericEncode :: forall rep a. Generic a rep => GenericEncode rep => Options -> a -> ForeignGenerate a Foreign value compatible with the readGeneric function.
#decodeJSON Source
decodeJSON :: forall a. Decode a => String -> F aDecode a JSON string using a Decode instance.
#encodeJSON Source
encodeJSON :: forall a. Encode a => a -> StringEncode a JSON string using an Encode instance.
#genericDecodeJSON Source
genericDecodeJSON :: forall rep a. Generic a rep => GenericDecode rep => Options -> String -> F aRead a value which has a Generic type from a JSON String
#genericEncodeJSON Source
genericEncodeJSON :: forall rep a. Generic a rep => GenericEncode rep => Options -> a -> StringWrite a value which has a Generic type as a JSON String