Skip to content

De/Encode instance for Data.Map #40

Open
@rubenpieters

Description

@rubenpieters

I'm wondering what the preferred way of writing a de/encode instance for Data.Map would be?

I have an initial implementation in a fork here ( rubenpieters@e2f24ed ).

Some choices I made:

  • Convert the Data.Map from/to a Data.StrMap, then encode/decode it similarly to Data.StrMap's instance
  • All keys are first converted to Strings, so I introduced an EncodeKey/DecodeKey class which can encode or decode keys to/from String respectively

Also in the initial implementation only the first decoding error is reported, I think the current StrMap doesn't report all decoding errors either. But that can definitely be fixed.

There are a lot of possibilities, so maybe it would be interesting to discuss the preferred way of doing it first.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions