You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm working with dictionaries of character-based keys. Encoding them is straight-forward, as I simply have to convert keys from characters to strings. No problem!
Writing the decoder for this kind of dictionary was more problematic, as I don't have the option convert keys back into characters.
Encode.dict :(k ->String)->(v ->Encode.Value)->Dict k v ->Encode.ValueDecode.dict :Decoder a ->Decoder(DictString a)
I am working around this, but I'd love for the solution to be incorporated into Decode.dict, to avoid the additional passes through the data.
Proposed solution
I'd really like these functions to be symmetrical, in the sense that the dictionary-decoder takes a function to convert the string-key into a comparable value in the same way the encoder requires me to convert the comparable keys into strings.
Perhaps like this:
Decode.dict :(String-> comparable)->Decoder a ->Decoder(Dict comparable a)
To spare you the time, I could do this implementation for you, but let me know what you think when you have the time ☀️
The text was updated successfully, but these errors were encountered:
Hello!
I'm working with dictionaries of character-based keys. Encoding them is straight-forward, as I simply have to convert keys from characters to strings. No problem!
Writing the decoder for this kind of dictionary was more problematic, as I don't have the option convert keys back into characters.
I am working around this, but I'd love for the solution to be incorporated into
Decode.dict
, to avoid the additional passes through the data.Proposed solution
I'd really like these functions to be symmetrical, in the sense that the dictionary-decoder takes a function to convert the string-key into a comparable value in the same way the encoder requires me to convert the comparable keys into strings.
Perhaps like this:
To spare you the time, I could do this implementation for you, but let me know what you think when you have the time ☀️
The text was updated successfully, but these errors were encountered: