Add Option.mapEffect
for better native interoperability between Option and Effect.
#4589
Labels
enhancement
New feature or request
What is the problem this feature would solve?
I frequently want to take an option like
Option.Option<number>
and apply some effect to the result to turn that option intoOption.Option<Effect.Effect<Something>>
but the options to do so feel really clunky in comparison to a simpleOption.mapEffect
call.Here's a breakdown of the existing ways I've tried to solve the issue: https://effect.website/play#be67835bcf4d
What is the feature you are proposing to solve the problem?
My proposed solution would look like this:
Here's a full example: https://effect.website/play#be67835bcf4d
What alternatives have you considered?
I've tried unwrapping the option and catching and now using
Effect.transposeOption
but I still think this simple api would make for a much nicer one-liner for dealing with this situation.The text was updated successfully, but these errors were encountered: