json icon indicating copy to clipboard operation
json copied to clipboard

Json.Json!

Open pravdomil opened this issue 4 years ago • 1 comments

Similar to Bytes.Bytes and Bytes.Encode, Bytes.Decode.

I would be nice to have Json.Json type and remove Encode.Value and Decode.Value.

I was confused what is difference between Encode.Value and Decode.Value. And then I check the source code and realize that it is alias.

I would say that having Json.Json type will make very clear - it is a JSON!

What do you think?

pravdomil avatar Jul 25 '21 14:07 pravdomil

As it's not guaranteed to carry a value in valid JSON format – It's a js value – I'd be in favor of calling it Json.JsMagicValue or something in that direction; hinting that it's compiler magic which isn't caseable and can cause elm to fail on == (#29 #30 related) and which can include functions, proxies, getters, bigInts, anything.

and.. which can be abused to break elm's promises

(sorry for snitching)

lue-bird avatar May 09 '22 22:05 lue-bird