Module

Data.Argonaut.Generic.Decode

Package
purescript-argonaut-generic-codecs
Repository
eskimor/purescript-argonaut-generic-codecs

Flexible generic decoding. Use this for defining your own custom encodings or use "Data.Argonaut.Generic.Aeson" and "Data.Argonaut.Generic.Argonaut" for concrete codecs.

#genericDecodeJson Source

genericDecodeJson :: forall a. Generic a => Options -> Json -> Either String a

Decode Json representation of a value which has a Generic type.

#genericUserDecodeJson' Source

genericUserDecodeJson' :: Options -> GenericSignature -> Json -> Either String GenericSpine

Generically decode json, using a supplied userEncoding, falling back to genericEncodeJson':

#genericDecodeJson' Source

genericDecodeJson' :: Options -> GenericSignature -> Json -> Either String GenericSpine

Decode Json representation of a GenericSpine.

#mFail Source

mFail :: forall a. String -> Maybe a -> Either String a

Re-exports from Data.Argonaut.Generic.Options

#SumEncoding Source

data SumEncoding

Constructors

#Options Source

newtype Options

Constructors

#dummyUserEncoding Source

dummyUserEncoding :: Options -> GenericSignature -> GenericSpine -> Maybe Json

Use this for userEncoding if you don't want any special rules.

#dummyUserDecoding Source

dummyUserDecoding :: Options -> GenericSignature -> Json -> Maybe (Either String GenericSpine)

Use this for userDecodeing if you don't want any special rules.