A pessimistic definition would seem to be:

* A value with function type is non-equatable
* A tuple, tagged value, union, or record containing a non-equatable value is 
non-equatable
* A type parameterized by a non-equatable type is non-equatable

In other words, non-equatableness spreads pessimistically rather than trying to 
spread equatableness as is done with comparability.

In the other direction, however, we have to spread the need for a type to be 
equatable because we compare two values of that type for equality or inequality.

The downside to this pessimistic approach is that one could not compare a Maybe 
function against Nothing because a Maybe function would be non-equatable. On 
the other hand, one could pattern match it, so I don't know that this is a huge 
problem.

A bigger problem is that the requirement that something be equatable or the 
property that a type is not equatable becomes a hidden part of the interface.

Mark

> On Jul 11, 2016, at 9:25 AM, Max Goldstein <[email protected]> wrote:
> 
> In my animation library, I define an 'equal' function because animations 
> include a function. I sample the function maybe 5 times for each animation; 
> it's rare to get a false positive. 
> 
> It's possible that the "marketing" needs to be clarified, but it will always 
> be possible to get a runtime error in Elm since it's Turing complete and the 
> stack is finite. You can also get errors from ports, and from a few remaining 
> language and tooling bugs. What is meant is that you don't get errors on a 
> production system that seemed fine in testing. 
> 
> -- 
> 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