@Test public void bracketCons(){ assertFalse(closed); ioMonad(reactiveSeqConverter,ReactiveSeq.of(10)) .bracket(i-> new IOMonadTest.MyCloseable(), b->{ try { b.close(); } catch (Exception e) { e.printStackTrace(); } }) .run(); assertTrue(closed); }
public static <W,T> IOMonad<W,T> ioMonad(Monad<W> monad, Higher<W,T> hkt, ToPublsher<W> to, FromPublsher<W> from){ return new IOMonad<W,T>(monad,hkt,to,from); }
IOMonad implements IO<T> { public static <W,T> IOMonad<W,T> ioMonad(Monad<W> monad, Higher<W,T> hkt, ToPublsher<W> to, FromPublsher<W> from){ return new IOMonad<W,T>(monad,hkt,to,from); } }
IOMonad implements IO<T> { public static <W,T> IOMonad<W,T> ioMonad(Monad<W> monad, Higher<W,T> hkt, ToPublsher<W> to, FromPublsher<W> from){ return new IOMonad<W,T>(monad,hkt,to,from); }  }
IOMonad implements IO<T> { public static <W,T> IOMonad<W,T> ioMonad(Monad<W> monad, Higher<W,T> hkt, ToPublsher<W> to, FromPublsher<W> from){ return new IOMonad<W,T>(monad,hkt,to,from); }  static IOMonad<W,T> ioMonad(Monad<W> monad, Higher<W,T> hkt, ToPublsher<W> to, FromPublsher<W> from); static IOMonad<W,T> ioMonad(Converter<W>  converter,Higher<W,T> hkt); @Override IO<R> map(Function<? super T, ? extends R> s); @Override IO<R> flatMap(Function<? super T, IO<? extends R>> s); @Override IO<R> mergeMap(int maxConcurrency, Function<? super T, Publisher<? extends R>> s); @Override Publisher<T> publisher(); String toString(); }
IOMonad implements IO<T> { public static <W,T> IOMonad<W,T> ioMonad(Monad<W> monad, Higher<W,T> hkt, ToPublsher<W> to, FromPublsher<W> from){ return new IOMonad<W,T>(monad,hkt,to,from); }  static IOMonad<W,T> ioMonad(Monad<W> monad, Higher<W,T> hkt, ToPublsher<W> to, FromPublsher<W> from); static IOMonad<W,T> ioMonad(Converter<W>  converter,Higher<W,T> hkt); @Override IO<R> map(Function<? super T, ? extends R> s); @Override IO<R> flatMap(Function<? super T, IO<? extends R>> s); @Override IO<R> mergeMap(int maxConcurrency, Function<? super T, Publisher<? extends R>> s); @Override Publisher<T> publisher(); String toString(); static Converter<reactiveSeq> reactiveSeqConverter; static Converter<future> futureConverter; }