Conversation
|
Thanks for this @CarstenKoenig. I'm just taking a look, and I'm confused by the decoder. Take a look at this Haskell code: ...so Aeson encodes an IntMap as a list of pairs. Which doesn't seem to fit with the decoder you've PRd. Thoughts? |
|
hmm ... I see your point - and this might be a problem - I used a simple Prelude> import Data.Aeson
Prelude Data.Aeson> import Data.Map
Prelude Data.Aeson Data.Map> let a = fromList [(1,"Alice"),(2,"Bob")]
Prelude Data.Aeson Data.Map> a
fromList [(1,"Alice"),(2,"Bob")]
Prelude Data.Aeson Data.Map> encode a
"{\"1\":\"Alice\",\"2\":\"Bob\"}"now I'm not really sure what to do here aside from introducing a different data-constructor ( On the other hand it might be sensible to tell people (me included) to just use What do you think? PS: btw - that explains your very sensible test case I destroyed there (sorry) - should have had a more careful look at things |
|
ok - I added basic support for the idea I gave above - it should now tread |
I had an issues with Int-keyed dicts and this one solves it (basically the same as #37)
BTW: this is the example this PR fixes: https://github.com/CarstenKoenig/YouVote/blob/master/src/server/Poll/Models.hs