MCPcopy
hub / github.com/Effect-TS/effect / fromIterable

Function fromIterable

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

Source from the content-addressed store, hash-verified

388 * @since 2.0.0
389 */
390export const fromIterable = <A>(collection: Iterable<A>): Option<A> => {
391 for (const a of collection) {
392 return some(a)
393 }
394 return none()
395}
396
397/**
398 * Converts an `Either` into an `Option` by discarding the error and extracting

Callers

nothing calls this directly

Calls 2

noneFunction · 0.85
someFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…