Think we need:
```scala
 @tailrec
 final def effect(f: T => (S,T)): (S,T) = {
   val oldValue = atomic.get()
   val withEffect = f(oldValue)
   if (atomic.compareAndSet(oldValue, withEffect._2)) withEffect else update(f)
}
```