My response to team members who pointed to it was that `comparable` is a 
code/compiler smell but it's one taken to keep the language simpler overall 
because there aren't a huge number of cases where one really needs typeclass 
functionality. One can cite JavaScript as a language that does just fine using 
only strings for keys.

That said, there are a couple of further wrinkles that came up in our 
discussion. For example, Lua does allow arbitrary values as keys and this is 
really useful in some cases. That said, Lua uses reference equality rather than 
value equality to support it.

(That reference equality v value equality issue then leads back to my biggest 
complaint about Elm which is that it will throw a runtime exception for 
function comparison — an operation that would be safe in just about any other 
language, particularly JavaScript. The defense of this is that value equality 
for functions is undecidable but then there really ought to be an equatable 
typeclass that would go along with comparable — more compiler smells and won't 
we be surprised when lots of things turn out not to be equatable. Personally, I 
prefer the compromise of just saying that functions that can't readily be 
proven equal are considered unequal.)

But turning back to the blog post, perhaps the best defense of Elm against this 
sort of attack is to say that Elm is an exploration of how much power you can 
get with how small a subset of Haskell and the answer seems to be quite a lot.

Mark 

> On Nov 9, 2016, at 1:27 PM, Gaëtan André <[email protected]> wrote:
> 
> Hello,
> 
> A bit of a bad buzz today around Elm:
> https://news.ycombinator.com/item?id=12906119 
> 
> As a newcomer it puzzles me. What are your opinions on it?
> -- 
> 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.

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

Reply via email to