(collection: Iterable<A>)
| 502 | * @since 2.0.0 |
| 503 | */ |
| 504 | export 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. |