What is the idiomatic fp alternative of forEach
part in this code
const ios: IO<void>[] = [...]
ios.forEach(io => io());
?
There are some docs which use sequence_
from Foldable
but it is no longer available in fp-ts@2.0.3.
EDIT:
The best I could do is
import { array } from 'fp-ts/lib/Array';
array.sequence(io)(ios)();
but sequence
collects the results and I do not really have anything to do with void[]
.