|
|
|
|
|
by nilkn
3440 days ago
|
|
Current version: https://hackage.haskell.org/package/aeson-1.1.0.0/docs/Data-... The key difference with Aeson is this line: > deriving (Generic, Show) Because of this, it's not necessary in that example to even write the JSON decoder manually. The compiler can generate it on its own. I don't personally know of any way to achieve this in Elm, as Elm doesn't have typeclasses and what's effectively happening here is that an instance of the FromJSON typeclass is being computed by the compiler. A very similar trick is possible in PureScript: http://www.purescript.org/learn/generic/ |
|