Skip to content

Provide a way to override generic encoding/decoding for certain data types #14

@eskimor

Description

@eskimor

For encoding Nothing as null for example, or Tuple a b as [a, b], ....
We could include options in Data.Argonaut.Options.Options, called userEncoding, userDecoding:

userEncoding :: GenericSignature -> GenericSpine -> Maybe Json
userDecoding :: GenericSignature -> Json -> Maybe GenericSpine

or something like this. genericEncodeJson'/genericDecodeJson' would then try those functions first on each recursion. Thus, the user can choose to override the encoding/decoding for certain signatures.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions