-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Open
Labels
Description
Change from IndexedStateT[F[_], SA, SB, A] to IndexedStateT[F[_], -SA, SB, A]
Example of use:
trait Animal { def age: Int }
case class Cat(age: Int) extends Animal
val incrementCatAge: IndexedStateT[Id, Cat, Cat, Unit] = IndexedStateT.modify(cat => cat.copy(age = cat.age + 1))
val incrementAnimalAge: IndexedStateT[Id, Animal, Int, Unit] = IndexedStateT.modify(_.age + 1)
val composite = for {
_ <- incrementCatAge
_ <- incrementAnimalAge
r <- IndexedStateT.get[Id, Int]
} yield rLukaJCB and valentin-panalyt