Skip to content

Instantly share code, notes, and snippets.

@otto-dev
otto-dev / EffectfulState.scala
Last active November 17, 2021 11:25
Atomic sequential effectual operations on a state using cats effect
package xyz.neurotrade.tax
import cats.effect.std.Queue
import cats.effect.{Async, Resource}
import cats.implicits._
object EffectfulRef {
def apply[F[_]: Async, S](
initialState: S,
): Resource[F, EffectfulRef[F, S]] = for {