MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/programming/comments/e7r4s1/json_decoding_in_elm/fa4r1qr
r/programming • u/kvalle • Dec 08 '19
56 comments sorted by
View all comments
Show parent comments
1
But you can initialize recodes with named arguments in Elm ({ a = 1, b = 3 }).I think positional is fine for a small number of fields, e.g. in Vector3 1 2 3 it's fine, but for more fields it becomes a readability issue.
{ a = 1, b = 3 }
Vector3 1 2 3
1 u/kankyo Dec 08 '19 Sort of. But you don't have setters in elm (just getters!) so you can't write deserializers in a nice way with names arguments. This is bad.
Sort of. But you don't have setters in elm (just getters!) so you can't write deserializers in a nice way with names arguments. This is bad.
1
u/Zinggi57 Dec 08 '19
But you can initialize recodes with named arguments in Elm (
{ a = 1, b = 3 }).I think positional is fine for a small number of fields, e.g. in
Vector3 1 2 3it's fine, but for more fields it becomes a readability issue.