[Haskell-cafe] Monad laws
Alexander Solla
alex.solla at gmail.com
Mon Jun 30 07:48:35 UTC 2014
On Sun, Jun 29, 2014 at 4:29 PM, Mike Meyer <mwm at mired.org> wrote:
> On Sun, Jun 29, 2014 at 6:05 PM, Alexander Solla <alex.solla at gmail.com>
> wrote:
>
>>
>>> Is x == x being false really any more surprising than x + 1 == x being
>>> true?
>>>
>>
>> Yes, a lot more. Equality is a symmetric relation. So "x equals x" is
>> true for every x. A logic/language in which that is not true is unsound.
>>
>> x + 1 == x is just an equation. Coming up with a theory where it holds
>> is straightforward. For example, addition followed by the "fractional
>> part" operation, on the set [0,1].
>>
>
> Your theory is wrong. This is the same problem you run into with "x == x"
> being False: you create theories from assumptions about how these things
> behave based on your experience with abstract mathematical objects, and
> there are values for which those assumptions do not hold. Surprise results
> when you run into those cases.
>
You can call it "wrong", but it doesn't make it so. (==) is supposed to
model (witness) equality. The laws for Eq are the theory.
>
> IEEE 754 floats under + and * are *not* ℝ. Or even ℚ. They just play them
> in the computer. There are simple large subsets of possible operands for
> which addition (and hence the other three operators) doesn't work like the
> mathematical realities they model.
>
I didn't say they are. I had not committed myself to any position about
floating point numbers. They are certainly degenerate objects, similar to
bottom, and do not "model" numbers. Specifically because they (floats)
I think the problem here is that you're confusing the theory with the
model. You are definitely misusing the terminology, and unfortunately,
projecting at us for not understanding it they way you want us to.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20140630/3dd8bdd8/attachment.html>
More information about the Haskell-Cafe
mailing list