purescript-contrib/purescript-argonaut-codecs

`Map String a` <-> Object

flip111 opened this issue · 1 comments

Following the discussion here #101

Could an EncodeJson / DecodeJson for Map String a be provided that convert from/to a javascript object instead of an array?

I think that this is the desired behavior in nearly all situations and when it isn't people can manually write their codec.

garyb commented

The proposed instance overlaps with the existing Map instance, so it's not really an option unfortunately.

If you want that encoding for with the least amount of work possible, maybe use an Object rather than a Map - it has much the same interface as Map but is restricted to String keys and will encode the way you're looking for.