(collection: Iterable<A>)
| 485 | * @since 2.0.0 |
| 486 | */ |
| 487 | export const fromIterable = <A>(collection: Iterable<A>): Option<A> => { |
| 488 | for (const a of collection) { |
| 489 | return some(a) |
| 490 | } |
| 491 | return none() |
| 492 | } |
| 493 | |
| 494 | /** |
| 495 | * Converts a `Result` into an `Option`, keeping only the success value. |