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

Function result

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

Source from the content-addressed store, hash-verified

1977 * @since 4.0.0
1978 */
1979export const result = <A, E, R>(self: Stream<A, E, R>): Stream<Result.Result<A, E>, never, R> =>
1980 self.pipe(
1981 map(Result.succeed),
1982 catch_((e) => succeed(Result.fail(e)))
1983 )
1984
1985/**
1986 * Runs the provided effect for each element while preserving the elements.

Callers

nothing calls this directly

Calls 4

mapFunction · 0.85
succeedFunction · 0.70
pipeMethod · 0.65
failMethod · 0.45

Tested by

no test coverage detected