A generalization of StoreT
, where the underlying functor F
has a Representable
instance.
Store
is the dual of State
A generalization of StoreT
, where the underlying functor F
has a Representable
instance.
Store
is the dual of State
- Companion
- object
Value members
Concrete methods
coflatMap
is the dual of flatMap
on FlatMap
. It applies
a value in a context to a function that takes a value
in a context and returns a normal value.
coflatMap
is the dual of flatMap
on FlatMap
. It applies
a value in a context to a function that takes a value
in a context and returns a normal value.
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"))
Peek at what the focus would be for a given focus s.
Peek at what the focus would be for a given focus s.
Peek at what the focus would be if the current focus where transformed with the given function.
Peek at what the focus would be if the current focus where transformed with the given function.