Skip to content

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

Open
@mb64

Description

@mb64

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions