fetch

decrel.reify.fetch
trait fetch[F[_]] extends catsMonad[[_] =>> Fetch[F, _$2]]

Instantiate this trait in one place in your app pass around the object, importing it where you want to use it.

Attributes

F

Underlying effect type, usually cats.effect.IO or similar.

Graph
Supertypes
trait catsMonad[[_] =>> Fetch[F, _$2]]
trait module[[_] =>> Fetch[F, _$2]]
trait reifiedRelation
trait proof
trait access
class Object
trait Matchable
class Any
Self type

Members list

Concise view

Type members

Classlikes

implicit class CacheOps(cache: Cache)

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
implicit class FetchReifiedRelationOps[In, Out](rel: ReifiedRelation[In, Out])

Syntax for Relation values

Syntax for Relation values

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
implicit class FetchRelationOps[Rel, In, Out](rel: Rel & Relation[In, Out])

Syntax for Relation values

Syntax for Relation values

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
implicit class RefCacheOps(refCache: Ref[F, Cache])

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any

Inherited classlikes

abstract class Proof[+Rel, -In, Out]

A Proof shows that a relation is reifiable as In => Access[Out].

A Proof shows that a relation is reifiable as In => Access[Out].

In practice, this data structure is the outer shell of ReifiedRelation that guides the implicit derivation mechanism.

Attributes

Inherited from:
proof
Graph
Supertypes
class Object
trait Matchable
class Any
object Proof

Attributes

Inherited from:
proof
Graph
Supertypes
class Object
trait Matchable
class Any
sealed abstract class ReifiedRelation[-In, Out]

Defines the behavior of Proofs. The below cases embody the patterns in which the reifiedRelations can actually be composed. Composition patterns of of ReifiedRelation is orthogonal to the composition patterns of Proofs.

Defines the behavior of Proofs. The below cases embody the patterns in which the reifiedRelations can actually be composed. Composition patterns of of ReifiedRelation is orthogonal to the composition patterns of Proofs.

Notice that there is no Rel type parameter. This is because it's not relevant when the relations are already reified.

Attributes

Inherited from:
reifiedRelation
Graph
Supertypes
class Object
trait Matchable
class Any

Attributes

Inherited from:
reifiedRelation
Graph
Supertypes
class Object
trait Matchable
class Any
implicit class relationOps[Rel, In, Out](val rel: Rel & Relation[In, Out])

Attributes

Inherited from:
proof
Graph
Supertypes
class Object
trait Matchable
class Any

Inherited types

override type Access[A] = F[A]

An Access datatype represents an action, when evaluated, brings a value of type A into memory. The datatype needs to be monadic for the derivation mechanism to work.

An Access datatype represents an action, when evaluated, brings a value of type A into memory. The datatype needs to be monadic for the derivation mechanism to work.

Attributes

Inherited from:
module

Value members

Concrete methods

def contramapManyProof[Rel, NewRel, In, Out, B, CC <: ([T] =>> Iterable[T] & IterableOps[T, LazyRef(...), LazyRef(...)])](proof: Proof[Rel, In, Out], rel: NewRel & Many[B, CC, Out], f: B => CC[In]): Many[NewRel & Many[B, CC, Out], B, CC, Out]
def contramapOneProof[Rel, NewRel, In, Out, B](proof: Proof[Rel, In, Out], rel: NewRel & Single[B, Out], f: B => In): Single[NewRel & Single[B, Out], B, Out]
def contramapOptionalProof[Rel, NewRel, In, Out, B](proof: Proof[Rel, In, Out], rel: NewRel & Optional[B, Out], f: B => Option[In]): Optional[NewRel & Optional[B, Out], B, Out]
override protected def foreach[Coll <: (Iterable), A, B](collection: Coll[A])(f: A => Fetch[F, B])(implicit bf: BuildFrom[Coll[A], B, Coll[B]]): Fetch[F, Coll[B]]

aka traverse.

aka traverse.

If you are implementing Access with your own datatype, and if you want batching/parallel behavior, please override this default behavior with a more efficient version that comes with your datatype.

See zquery or fetch modules for examples.

Attributes

Definition Classes
access
def implementCustomDatasource[Tree, In, Out](relation: Custom[Tree, In, Out])(batchExecute: List[In] => F[List[(In, Out)]])(implicit tag: Tag[Custom[Tree, In, Out]]): Proof[Custom[Tree, In, Out], In, Out]
def implementManyDatasource[Rel : Tag, In, CC <: ([A] =>> Iterable[A] & IterableOps[A, LazyRef(...), LazyRef(...)]), Out](relation: Rel & Many[In, CC, Out])(batchExecute: List[In] => F[List[(In, CC[Out])]]): Many[Rel & Many[In, CC, Out], In, CC, Out]
def implementOptionalDatasource[Rel : Tag, In, Out](relation: Rel & Optional[In, Out])(batchExecute: List[In] => F[List[(In, Option[Out])]]): Optional[Rel & Optional[In, Out], In, Out]
def implementSingleDatasource[Rel : Tag, In, Out](relation: Rel & Single[In, Out])(batchExecute: List[In] => F[List[(In, Out)]]): Single[Rel & Single[In, Out], In, Out]

Inherited methods

protected def flatMap[A, B](access: Fetch[F, A])(f: A => Fetch[F, B]): F[B]

Good ol' flatMap.

Good ol' flatMap.

To traverse a relation graph edge by edge is sequential computation, so we require flatMap to be implemented on Access.

Attributes

Inherited from:
catsMonad
protected def map[A, B](access: Fetch[F, A])(f: A => B): F[B]

Plain ol' map.

Plain ol' map.

Can be implemented in terms of flatMap and succeed, but probably a bad idea considering what kinds of datatypes will be used to implement Access.

Attributes

Inherited from:
catsMonad
protected def succeed[A](a: A): F[A]

aka pure, point, ...

aka pure, point, ...

Attributes

Inherited from:
catsMonad

Implicits

Implicits

implicit protected val CF: Concurrent[F]
final implicit def CacheOps(cache: Cache): CacheOps
implicit override protected val F: Monad[[_] =>> Fetch[F, _$3]]
final implicit def FetchReifiedRelationOps[In, Out](rel: ReifiedRelation[In, Out]): FetchReifiedRelationOps[In, Out]

Syntax for Relation values

Syntax for Relation values

Attributes

final implicit def FetchRelationOps[Rel, In, Out](rel: Rel & Relation[In, Out]): FetchRelationOps[Rel, In, Out]

Syntax for Relation values

Syntax for Relation values

Attributes

final implicit def RefCacheOps(refCache: Ref[F, Cache]): RefCacheOps

Inherited implicits

final implicit def relationOps[Rel, In, Out](rel: Rel & Relation[In, Out]): relationOps[Rel, In, Out]

Attributes

Inherited from:
proof