final case class RepresentableStore[F[_], S, A](fa: F[A], index: S)(implicit R: Aux[F, S]) extends Product with Serializable
A generalisation of the Store comonad, for any Representable
functor.
Store
is the dual of State
Linear Supertypes
Ordering
- Alphabetic
- By Inheritance
Inherited
- RepresentableStore
- Serializable
- Serializable
- Product
- Equals
- AnyRef
- Any
- Hide All
- Show All
Visibility
- Public
- All
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
-
lazy val
coflatten: RepresentableStore[F, S, RepresentableStore[F, S, A]]
Duplicate the store structure
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
experiment[G[_]](fn: (S) ⇒ G[S])(implicit 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"))
-
lazy val
extract: A
Extract the value at the current index.
- val fa: F[A]
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- val index: S
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def map[B](f: (A) ⇒ B): RepresentableStore[F, S, B]
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
def
peek(s: S): A
Inspect the value at "index" s
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )