Comments (2)
Yep. Will do that next week.
from elm-export.
@ehamberg Any chance you could submit your fix for the string key case as a PR? it seems to be the correct behaviour.
I was looking into this a bit more and aeson seems to stick with a simple key/value encoding for maps with simple types such as String or Int, so these will all fail with the current implementation as far as I an see, e.g.
> let x=M.fromList [(1, "1"), (2, "2"), (3, "3)] :: M.Map Int String
> Data.Aeson.encode x
"{\"1\":\"1\",\"2\":\"2\",\"3\":\"3\"}"
But for more complex cases, such as tuple keys, it switches to using lists:
> x = M.fromList [((1,1),"1"),((2,2),"2"),((3,3),"3")]
> > Data.Aeson.encode x
"[[[1,1],\"1\"],[[2,2],\"2\"],[[3,3],\"3\"]]"
I'd expect the primitive (particularly string) key cases will be the most common, so it would be nice to have a fix in place.
from elm-export.
Related Issues (20)
- Document Elm requirements HOT 2
- Don't generate names with primes HOT 4
- Json.Decode.tuple2 removed in Elm 0.18 HOT 2
- Types of kind * -> * HOT 1
- Update for Elm 0.18. HOT 1
- Improved pretty-printing HOT 3
- elm-export 0.6.0.0 generates wrong Elm ref HOT 2
- We need docstrings. HOT 1
- HasDecoder instance for ElmConstructor is partial HOT 1
- Invalid encoder for `Date` HOT 4
- Can't derive encoders for records with modified field names
- Support for optional fields
- Export internal types HOT 1
- "Non-exhaustive patterns in function render" for ElmConstructor HOT 1
- generateElmForAPIWith Supports Other types other than Json
- State of the project
- Error while encoding a newtype
- Upgrade to Elm 0.19 HOT 1
- Directories not created
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from elm-export.