Class Until<A>

  • Type Parameters:
    A - the IO value type
    All Implemented Interfaces:
    Fn1<Fn1<? super A,​? extends java.lang.Boolean>,​Fn1<IO<A>,​IO<A>>>, Fn2<Fn1<? super A,​? extends java.lang.Boolean>,​IO<A>,​IO<A>>, Applicative<Fn1<IO<A>,​IO<A>>,​Fn1<Fn1<? super A,​? extends java.lang.Boolean>,​?>>, Cartesian<Fn1<? super A,​? extends java.lang.Boolean>,​Fn1<IO<A>,​IO<A>>,​Fn1<?,​?>>, Cocartesian<Fn1<? super A,​? extends java.lang.Boolean>,​Fn1<IO<A>,​IO<A>>,​Fn1<?,​?>>, Contravariant<Fn1<? super A,​? extends java.lang.Boolean>,​Profunctor<?,​Fn1<IO<A>,​IO<A>>,​Fn1<?,​?>>>, Functor<Fn1<IO<A>,​IO<A>>,​Fn1<Fn1<? super A,​? extends java.lang.Boolean>,​?>>, Profunctor<Fn1<? super A,​? extends java.lang.Boolean>,​Fn1<IO<A>,​IO<A>>,​Fn1<?,​?>>, Monad<Fn1<IO<A>,​IO<A>>,​Fn1<Fn1<? super A,​? extends java.lang.Boolean>,​?>>, MonadReader<Fn1<? super A,​? extends java.lang.Boolean>,​Fn1<IO<A>,​IO<A>>,​Fn1<Fn1<? super A,​? extends java.lang.Boolean>,​?>>, MonadRec<Fn1<IO<A>,​IO<A>>,​Fn1<Fn1<? super A,​? extends java.lang.Boolean>,​?>>, MonadWriter<Fn1<? super A,​? extends java.lang.Boolean>,​Fn1<IO<A>,​IO<A>>,​Fn1<Fn1<? super A,​? extends java.lang.Boolean>,​?>>

    public final class Until<A>
    extends java.lang.Object
    implements Fn2<Fn1<? super A,​? extends java.lang.Boolean>,​IO<A>,​IO<A>>
    Given a predicate function for a value of some type A and an IO that yields a value of type A, produce an IO that repeatedly executes the original IO until the predicate returns true when applied to the yielded value.
    • Field Detail

      • INSTANCE

        private static final Until<?> INSTANCE
    • Constructor Detail

      • Until

        private Until()
    • Method Detail

      • checkedApply

        public IO<A> checkedApply​(Fn1<? super A,​? extends java.lang.Boolean> pred,
                                  IO<A> io)
        Specified by:
        checkedApply in interface Fn2<Fn1<? super A,​? extends java.lang.Boolean>,​IO<A>,​IO<A>>
      • until

        public static <A> Until<A> until()
      • until

        public static <A> Fn1<IO<A>,​IO<A>> until​(Fn1<? super A,​? extends java.lang.Boolean> pred)
      • until

        public static <A> IO<A> until​(Fn1<? super A,​? extends java.lang.Boolean> pred,
                                      IO<A> io)