The key mathematical property of equality is that a=b implies f(a)=f(b) for all possible functions f. It was a mistake of C++, C#, and Java to violate this. This is the ultimate cause of the conundrum @BarryRevzin discusses in https://brevzin.github.io/c++/2018/12/09/mixed-comparisons/ …
-
-
Haskell allows you to define custom equality that violates it, and has the silly non reflexive float equality too :(
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
Please add Asia servers to Xbox
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
When I s your birthday? It’s for a project of mine
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
Even in purely functional languages, it kind of depends on what you mean by equality. For example, a set with no total order on keys, using hashing for speed, can give different results for a function "return the set elements in a list", for two sets with the same elements.
-
Example of that in Haskell in an article I wrote on the topic: https://github.com/jafingerhut/thalia/blob/master/doc/other-topics/referential-transparency.md … If equals means "equal shape of data structure" then f(a) equal to f(b) is straightforward, but much less useful for comparing set equality.
End of conversation
New conversation -
-
-
Pure functional languages are useless, you can’t do anything useful without side effects, that’s why all functional languages provide ways to circumvent the type system.
-
Side effects can be modeled using Kleisli composition. That is as pure as it gets and far from any type system hacks. AFAIK
End of conversation
New conversation -
-
-
(Is `f` implied to be a polymorphic function here?)
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.