Skip to content

Assertion comparator functions can be streamlined #12

@TheRealOwenRees

Description

@TheRealOwenRees

We can eliminate the redundancy between our string and integer comparators by implementing a polymorphic type assertion. This allows a single function to handle any type safely by ensuring both operands share the same type identity.

export const assertEqual = `let assertEqual = (~message=?, a: 'a, b: 'a) => assertion(~message?, ~operator="assertEqual", (a, b) => a == b, a, b)`;

To tackle after Acronym is merged.

Metadata

Metadata

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