RepresentableStore

final case class RepresentableStore[F[_], S, A](fa: F[A], index: S)(R: Aux[F, S])

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
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any

Value members

Concrete methods

def coflatMap[B](f: RepresentableStore[F, S, A] => B): RepresentableStore[F, S, B]

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.

def experiment[G[_]](fn: S => G[S])(G: Functor[G]): G[A]

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"))
def map[B](f: A => B): RepresentableStore[F, S, B]

Functor map for RepresentableStore

Functor map for RepresentableStore

def peek(s: S): A

Peek at what the focus would be for a given focus s.

Peek at what the focus would be for a given focus s.

def peeks(f: S => S): A

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.

def seek(s: S): RepresentableStore[F, S, A]

Set the current focus.

Set the current focus.

def seeks(f: S => S): RepresentableStore[F, S, A]

Modify the current focus with the given function.

Modify the current focus with the given function.

Inherited methods

def productElementNames: Iterator[String]
Inherited from
Product
def productIterator: Iterator[Any]
Inherited from
Product

Concrete fields

coflatten is the dual of flatten on FlatMap. Whereas flatten removes a layer of F, coflatten adds a layer of F

coflatten is the dual of flatten on FlatMap. Whereas flatten removes a layer of F, coflatten adds a layer of F

lazy val extract: A

Extract the value at the current index.

Extract the value at the current index.