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

Function fromIterable

packages/effect/src/Option.ts:504–509  ·  view source on GitHub ↗
(collection: Iterable<A>)

Source from the content-addressed store, hash-verified

502 * @since 2.0.0
503 */
504export const fromIterable = <A>(collection: Iterable<A>): Option<A> => {
505 for (const a of collection) {
506 return some(a)
507 }
508 return none()
509}
510
511/**
512 * Converts a `Result` into an `Option`, keeping only the success value.

Callers

nothing calls this directly

Calls 2

someFunction · 0.70
noneFunction · 0.70

Tested by

no test coverage detected