@Test public void safeRunPar() { IO<ImmutableList<String>> program = currentThreadIO(); Par<ImmutableList<String>> result = program.foldMap(ParInstances.async()) .fix(toPar()); assertEquals(Try.success(5), result.apply(Future.DEFAULT_EXECUTOR).await().map(ImmutableList::size)); }
public <R> IO<R> apply(Function1<? super T, ? extends IO<? extends R>> use) { return use.andThen(IOOf::<R>narrowK).apply(resource); }
IOResource implements AutoCloseable { public <R> IO<R> apply(Function1<? super T, ? extends IO<? extends R>> use) { return use.andThen(IOOf::<R>narrowK).apply(resource); } }
IOResource implements AutoCloseable { public <R> IO<R> apply(Function1<? super T, ? extends IO<? extends R>> use) { return use.andThen(IOOf::<R>narrowK).apply(resource); } IOResource(T resource, Consumer1<? super T> release); }
IOResource implements AutoCloseable { public <R> IO<R> apply(Function1<? super T, ? extends IO<? extends R>> use) { return use.andThen(IOOf::<R>narrowK).apply(resource); } IOResource(T resource, Consumer1<? super T> release); IO<R> apply(Function1<? super T, ? extends IO<? extends R>> use); @Override void close(); }
IOResource implements AutoCloseable { public <R> IO<R> apply(Function1<? super T, ? extends IO<? extends R>> use) { return use.andThen(IOOf::<R>narrowK).apply(resource); } IOResource(T resource, Consumer1<? super T> release); IO<R> apply(Function1<? super T, ? extends IO<? extends R>> use); @Override void close();  }