Hyperlinkv0.8.0-beta.28

Effect

Effect.asSomeconsteffect/Effect.ts:2414
<A, E, R>(self: Effect<A, E, R>): Effect<Option<A>, E, R>

Maps the success value of an Effect to Some, preserving failures.

Example (Wrapping success in Option.some)

import { Effect } from "effect"

const program = Effect.asSome(Effect.succeed(42))

Effect.runPromise(program).then(console.log)
// { _id: 'Option', _tag: 'Some', value: 42 }
mapping
Source effect/Effect.ts:24141 lines
export const asSome: <A, E, R>(self: Effect<A, E, R>) => Effect<Option<A>, E, R> = internal.asSome
Referenced by 2 symbols