Sorry! Forgot to mention...
The automatic serializer/deserializers in the ports is assuming that the
main reason behind not serializing ADTs in the first place was this { _0,
_1... _n } shape.
The "native" object could also swap ctor to type: {type:"TypeValue", value:
xx} it's a type value, so {type, value} feels more explicit. But that I
guess is event more sensitive.
On Sunday, January 15, 2017 at 2:59:56 PM UTC+1, Maxime Dantec wrote:
>
> Hi folks,
>
> The last 3 versions of elm were somewhat unusual for a young programing
> language: features were removed and it has been simplified, to the point
> that you can't remove anything else. Well, about that.
>
> I believe that the last thing that could be simplified still are ADT. *No
> type value has more than one value in the core repository*, with the
> exception of Dict and Color. I have used a few types with more than one
> value myself, but I hardly see the difference with a type value that has 3
> values and a type value that has a tuple3 as unique value, if you except
> the constructor signature. Does yourself make an intensive usage of this
> feature?
>
> So here is my suggestion: Why not authorize up to one value to type
> values? If you need to bundle values, you can still use a tuple or a
> record. The reasoning behind this, is to get rid of the _0, _1, _2 in the
> "native" part of the type values. we could have {ctor:"Enum"} or
> {ctor:"TypeValue",
> value: {...}}, and why not automatic serializer/deserializers in the
> ports thanks to this too?
>
> Everyone has an opinion, and it's very easy to make a suggestion while not
> implementing it. I'm not pretending that this is a good idea, I humbly
> think that it's worth mentioning given that it's in the scope of
> simplifying the language. Please share you opinion :)
>
> Cheers!
>
--
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 [email protected].
For more options, visit https://groups.google.com/d/optout.