Duplicate the store structure
Given a functorial computation on the index S
peek at the value in that functor.
Given a functorial computation on the index S
peek at the value in that functor.
import cats._, implicits._, data.Store val initial = List("a", "b", "c") val store = Store(idx => initial.get(idx).getOrElse(""), 0) val adjacent = store.experiment[List] { idx => List(idx - 1, idx, idx + 1) } require(adjacent == List("", "a", "b"))
Extract the value at the current index.
Inspect the value at "index" s
A generalisation of the Store comonad, for any
Representable
functor.Store
is the dual ofState