Elm already has some built-in typeclass like concepts — e.g., comparable — so 
tracking equatable as a required property wouldn't seem like an entirely new 
notion. On the other hand, generating useful error messages would require being 
able to report the path through the logic that leads to where equatable matters 
and through the data structures to where equatable isn't feasible.

Mark

> On Jul 9, 2016, at 11:59 PM, Joey Eremondi <[email protected]> wrote:
> 
> Now, I'm not saying that it's worth it to have typeclasses, and I realize 
> there are disadvantages that make them likely unsuitable for Elm.
> 
> But when an issue like this arises, it's worth mentioning that this is 
> *exactly* the kind of problem that typeclasses solve.
> 
> Passing around a comparison function would also solve this, though in a 
> verbose way that, to my knowledge, nobody has actually really tried.
> 
>> On Jul 9, 2016 6:49 PM, "Max Goldstein" <[email protected]> wrote:
>> Yes, this is the expected behavior. You can't equate functions, even in 
>> theory, except that reference equality implies function equality. That's 
>> exactly what you see in your first case
>> 
>> Yes it would be nice for the compiler to catch this, but it's less trivial 
>> than you may think, since it has to track functions in data structures 
>> nested arbitrarily deeply.
>> 
>> --
>> 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.

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