[Haskell-cafe] Any precedent or plan for guaranteed-safe Eq and Ord instances?

Stijn van Drongelen rhymoid
Wed Oct 2 16:59:47 UTC 2013


On Wed, Oct 2, 2013 at 6:57 PM, Stijn van Drongelen <rhymoid at gmail.com>wrote:

>
> On Wed, Oct 2, 2013 at 5:36 PM, Roman Cheplyaka <roma at ro-che.info> wrote:
>
>> * Stijn van Drongelen <rhymoid at gmail.com> [2013-10-02 15:46:42+0200]
>> > I do think something has to be done to have an Eq and Ord with more
>> strict
>> > laws.
>> >
>> > * Operators in Eq and Ord diverge iff any of their parameters are
>> bottom.
>>
>> This outlaws the Eq instances of lists, trees, and other (co)recursive
>> types.
>>
>> Furthermore, in this formulation, even Eq for tuples is illegal, because
>>
>>   (undefined, something) == somethingElse
>>
>> is going to diverge.
>>
>> Roman
>>
>
> I knew this was going to bite me in the ass. Let me try again:
>
> * Operators in Eq and Ord may only diverge when any of their parameters
> are bottom.
>

What am I thinking. Scratch that.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20131002/571573bd/attachment.htm>



More information about the Haskell-Cafe mailing list