Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs: equality: mistake in "Types of equality" table #1766

Open
mb64 opened this issue Nov 10, 2024 · 1 comment
Open

Docs: equality: mistake in "Types of equality" table #1766

mb64 opened this issue Nov 10, 2024 · 1 comment

Comments

@mb64
Copy link

mb64 commented Nov 10, 2024

Hi all! I'd submit a PR but I can't find the source for the docs. On the page equality, the table says that equal-always is like OCaml's (=).

However, OCaml's (=) implements equal-now:

$ ocaml
# ref 3 = ref 3;;
- : bool = true
# ref 3 == ref 3;;
- : bool = false

I would recommend Haskell's == as an example of equal-always (I think SML's (=) too but I'm not an SML programmer):

ghci> x <- newIORef 3
ghci> y <- newIORef 3
ghci> x == y
False

A minor thing, but I have had a tricky bug in the past from using OCaml's (=) and thinking it was like Haskell's (==), so when I saw the table I thought I'd report it.

@sorawee
Copy link
Contributor

sorawee commented Nov 10, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants