On Wed, May 3, 2017 at 7:00 PM, Charles Scalfani <cscalf...@gmail.com>
wrote:

> Adding this to the language feels like how other languages evolve, which
> is haphazardly.
>
> I rather see a more general solution to this problem via some type of
> constraint-based type. For example, imagine you can define something as
> *String* but with a constraint that limits the values they can contain.
> This would solve all current problems we have with using types as Enums.
> We'd have exhaustive case statements checking and since it's already a
> String converting to String is unnecessary.
>

A general solution would bring its own set of issues as all general
solutions tend to be abused. As such, a general solution needs way way more
thought and design.

Anyway, I'm not arguing that what I said above is necessarily a good idea.
I haven't given it that much thought.
All I say is that it is one conceivable way.
The main advantage I see is that the language doesn't really change, it's
just a convention that turns some already expressible types into something
that can do a little bit more.




-- 
There is NO FATE, we are the creators.
blog: http://damoc.ro/

-- 
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.

Reply via email to