(index: number)
| 206 | from: number |
| 207 | ) => { |
| 208 | const forIndex = (index: number): STM.STM<Option.Option<number>, E, R> => |
| 209 | index < self.chunk.length |
| 210 | ? pipe( |
| 211 | tRef.get(self.chunk[index]), |
| 212 | core.flatMap(predicate), |
| 213 | core.flatMap((bool) => |
| 214 | bool ? |
| 215 | core.succeed(Option.some(index)) : |
| 216 | forIndex(index + 1) |
| 217 | ) |
| 218 | ) |
| 219 | : stm.succeedNone |
| 220 | return from < 0 |
| 221 | ? stm.succeedNone |
| 222 | : forIndex(from) |