In principle it’s correct. The type needs to be a bit different (comparable
instead of a). Moreover, it will still not work reliably if you call it
with something where the b type is itself a type that does not have
reliable ==. For example, if you call that dictEquals on a Dict Int (Set
Int), you can still be told that the things are unequal when actually they
are semantically equal.
​

2016-05-18 17:51 GMT+02:00 surfncode <jdupay...@gmail.com>:

> Thanks. That would be great. Can other experts confirm it works ?
>
> Le mercredi 18 mai 2016 17:11:56 UTC+2, Max Goldstein a écrit :
>>
>> Sorry, posted too soon.
>>
>> dictEquals : Dict a b -> Dict a b -> Bool
>> dictEquals d1 d2 =
>>   d1 == d2 || Dict.toList d1 == Dict.toList d2
>>
>> This will short-circuit when the object references are the same and
>> otherwise do the work necessary to always give the correct answer. (I think
>> - please tell me if I'm wrong.)
>>
> --
> 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.
>

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