Functional Equality (rewrite)
jonathanwarden.com·5d·
Discuss: r/programming
λFunctional Programming
Preview
Report Post

When 2 + 2 Does Not Equal 4.0

Introduction: What Do You Mean by Equal?

What does it mean for two values to be equal? In designing programming languages or defining types, we have to consider this question. And the wrong answer can create problems. It can lead to counter-intuitive surprises like in JavaScript where "" and [0] both are equal to 0 but not to each other. It can confuse programmers who expect two equal values to be the same, when they are actually quite different.

In this essay, I will compare functional equality with semantic equality and survey equality testing semantics across different programming languages.

Leibniz’s Law

Philosophers have long debated the question of what makes two things identical, and have come up with a criterion…

Similar Posts

Loading similar posts...