(collection: Iterable<A>)
| 388 | * @since 2.0.0 |
| 389 | */ |
| 390 | export 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 |