Skip to content

results: add mapConvertErr, mapCastErr#178

Merged
arnetheduck merged 3 commits intomasterfrom
maperr
Jun 28, 2023
Merged

results: add mapConvertErr, mapCastErr#178
arnetheduck merged 3 commits intomasterfrom
maperr

Conversation

@arnetheduck
Copy link
Member

We already have mapConvert and mapCast - this completes the API with corresponding Err versions similar to mapErr.

The Convert / Cast operators are of somewhat dubious value - ie they exist as "efficiency" shortcuts for map for the case that the mapping should be done as a simple cast / conversion - an alternative would be to deprecate these features and aim for some other, more generic version that involves a type conversion library such as #34, though this inherently, and perhaps rightly, would be limited to "error-free" conversions.

Regardless, these helpers provide balance to the existing API.

We already have `mapConvert` and `mapCast` - this completes the API with
corresponding `Err` versions similar to `mapErr`.

The `Convert` / `Cast` operators are of somewhat dubious value - ie
they exist as "efficiency" shortcuts for `map` for the case that the
mapping should be done as a simple cast / conversion - an alternative
would be to deprecate these features and aim for some other, more
generic version that involves a type conversion library such as
#34, though this inherently,
and perhaps rightly, would be limited to "error-free" conversions.

Regardless, these helpers provide balance to the existing API.
@arnetheduck arnetheduck merged commit d085e48 into master Jun 28, 2023
@arnetheduck arnetheduck deleted the maperr branch June 28, 2023 08:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant