At one stage there was suggestion of the compiler being able to derive JSON en/decoders automatically. This would be great - especially coming from JS-land where it's just JSON.parse(x) and JSON.stringify(y). I find the elm way of decoding JSON still a bit hard to grok. Defining a record "template" and having the encoder/decoders auto-generated at compile time would be ideal. I know someone made an external tool for this, I have yet to try, but baking it in to the core tooling and not having to even see deal with the generated code would be great.
On Wednesday, June 15, 2016 at 10:00:54 PM UTC+10, Gage Peterson wrote: > > Yes, that would be nice Zinggi > > On Wed, Jun 15, 2016, 5:49 AM Zinggi <schrot...@gmail.com <javascript:>> > wrote: > >> I think the only thing that could really benefit from a macro system in >> Elm would be a deriving clause similar to Haskell. >> This way we could get Json decoders for free: >> >> type alias Model = { foo: String, bar: Int } deriving Json.Decoder >> Which would generate modelDecoder : Json.Decoder Model >> >> This way we could add more stuff after deriving for different scenarios. >> >> >> On Saturday, 11 June 2016 21:26:55 UTC+2, Isaac Shapira wrote: >>> >>> Continuing the discussion started here: >>> >>> https://github.com/elm-lang/elm-compiler/issues/1413 >>> >> -- >> You received this message because you are subscribed to a topic in the >> Google Groups "Elm Discuss" group. >> To unsubscribe from this topic, visit >> https://groups.google.com/d/topic/elm-discuss/im2up0f59qs/unsubscribe. >> To unsubscribe from this group and all its topics, send an email to >> elm-discuss...@googlegroups.com <javascript:>. >> For more options, visit https://groups.google.com/d/optout. >> > -- You received this message because you are subscribed to the Google Groups "Elm Discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to elm-discuss+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.