Unwrapping Nested Effects and Options in Effect-TS

are there any functions to unwrap an effect within Option whilst keeping the Option (not moving none to the error channel)
for example if we have:
get: Effect<Option<number>>

Now I can have a gen:
Effect.gen(function* () {
  const anotherOption = yield* get
  const nestedOption = Option.map(anotherOption, () => get)
  // type of nestedOption: Option.Option<Effect.Effect<Option.Option<number>>>
  // Simplest way to return the nestedOption as Effect<Option<number>> or just Option<number>
  // basically flattening the 3 layers of effect and option but keeping it as option?
})


Playground: https://effect.website/play/#1fda9314f8da
Was this page helpful?