@Test public void lazySet() { Ref<String> ref = Ref.of("Hello World!"); UIO<Unit> lazySet = ref.lazySet("Something else"); UIO<String> result = lazySet.andThen(ref.get()); assertEquals("Something else", result.unsafeRunSync()); }
public UIO<Unit> lazySet(A newValue) { return UIO.task(() -> { value.lazySet(newValue); return unit(); }); }
Ref { public UIO<Unit> lazySet(A newValue) { return UIO.task(() -> { value.lazySet(newValue); return unit(); }); } }
Ref { public UIO<Unit> lazySet(A newValue) { return UIO.task(() -> { value.lazySet(newValue); return unit(); }); } private  Ref(AtomicReference<A> value); }
Ref { public UIO<Unit> lazySet(A newValue) { return UIO.task(() -> { value.lazySet(newValue); return unit(); }); } private  Ref(AtomicReference<A> value); UIO<A> get(); UIO<Unit> set(A newValue); UIO<Unit> lazySet(A newValue); UIO<A> getAndSet(A newValue); UIO<A> updateAndGet(Operator1<A> update); UIO<A> getAndUpdate(Operator1<A> update); static Ref<A> of(A value); @Override String toString(); }
Ref { public UIO<Unit> lazySet(A newValue) { return UIO.task(() -> { value.lazySet(newValue); return unit(); }); } private  Ref(AtomicReference<A> value); UIO<A> get(); UIO<Unit> set(A newValue); UIO<Unit> lazySet(A newValue); UIO<A> getAndSet(A newValue); UIO<A> updateAndGet(Operator1<A> update); UIO<A> getAndUpdate(Operator1<A> update); static Ref<A> of(A value); @Override String toString();  }