evilsoft / evilsoft/crocks

Update Writer To Take an Instance instead of a Value

Open
#201 2 comments 1 reaction 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

## Mistakes were Made

When `Writer` was first created, I thought it would be neat to let the `Writer` take care of lifting raw values into the underlying `Monoid`. This created many problems with this Datatype:

* Invalid values for the `Monoid` would throw deep in the `Writer` and out of context from where the value was "lifted". Makes for a nasty stack trace at best, and at worst you share way to much information between the type and your specific domain.
* Lose all power of the extra strength of the `Monoid`. So if an `Array` is used, you can never use the empty as there is no way other than and empty array to have a `void`-ish value.

This will be a breaking change.

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.