MCPcopy Create free account
hub / github.com/Effect-TS/effect / result

Function result

packages/effect/src/Stream.ts:2166–2170  ·  view source on GitHub ↗
(self: Stream<A, E, R>)

Source from the content-addressed store, hash-verified

2164 * @since 4.0.0
2165 */
2166export const result = <A, E, R>(self: Stream<A, E, R>): Stream<Result.Result<A, E>, never, R> =>
2167 self.pipe(
2168 map(Result.succeed),
2169 catch_((e) => succeed(Result.fail(e)))
2170 )
2171
2172/**
2173 * Runs the provided effect for each element while preserving the elements.

Callers

nothing calls this directly

Calls 4

succeedFunction · 0.70
pipeMethod · 0.65
failMethod · 0.65
mapFunction · 0.50

Tested by

no test coverage detected