evilsoft / evilsoft/crocks

`Monoid(undefined)` should be handled according to the rules on the Monoid

Open
#371 1 comment 0 reactions 0 assignees View on GitHub
breaking enhancement needs work
Dominant language
JavaScript
Stars
1.6k
Forks
103
PR merge metrics
No merged PRs in 30d

Description

**Is your feature request related to a problem? Please describe.**
A question was raise https://github.com/evilsoft/crocks/issues/301 by @bennypowers. Floating the idea of `m(nil)` returning an `empty` for the monoid.

**Describe the solution you'd like**
We will need to consider the behaviour of each `monoid` but if `undefined` hits the `monoid` and it is not expected we should handle it accordingly. In the case of `Any` and `All` which utilize coercion, should coerce into a `false`. All other `Monoid` should throw if their carrier type cannot deal with the unit.

**Describe alternatives for how you do this now**
@bennypowers can you add here if you have any

**Code**

**Additional context**

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.