Skip to content

Implementation of Result.equal and Result.compare treats all errors as equal #7931

@cknitt

Description

@cknitt

The implementation of Result.equal and Result.compare seems wrong as it treats any two errors as equal.

This is also the case with Belt.eq and Belt.cmp where this was likely copied from.

OCaml does this correctly in https://ocaml.org/manual/5.3/api/Result.html, equal and compare both take two functions, one for comparing the ok case and one for the error case.

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions