(
iterable: Iterable<A>,
f: (a: NoInfer<A>) => Micro<Option.Option<B>, E, R>,
options?: {
readonly concurrency?: Concurrency | undefined
}
)
| 4000 | * @category collecting & elements |
| 4001 | */ |
| 4002 | export const filterMap = <A, B, E, R>( |
| 4003 | iterable: Iterable<A>, |
| 4004 | f: (a: NoInfer<A>) => Micro<Option.Option<B>, E, R>, |
| 4005 | options?: { |
| 4006 | readonly concurrency?: Concurrency | undefined |
| 4007 | } |
| 4008 | ): Micro<Array<B>, E, R> => |
| 4009 | suspend(() => { |
| 4010 | const out: Array<B> = [] |
| 4011 | return as( |
| 4012 | forEach(iterable, (a) => |
| 4013 | map(f(a), (o) => { |
| 4014 | if (o._tag === "Some") { |
| 4015 | out.push(o.value) |
| 4016 | } |
| 4017 | }), { |
| 4018 | discard: true, |
| 4019 | concurrency: options?.concurrency |
| 4020 | }), |
| 4021 | out |
| 4022 | ) |
| 4023 | }) |
| 4024 | |
| 4025 | // ---------------------------------------------------------------------------- |
| 4026 | // do notation |
no test coverage detected
searching dependent graphs…