Packages

t

endless.core.entity

StateReaderHelpers

trait StateReaderHelpers[F[_], S] extends StateReader[F, S]

Set of convenience functions augmenting StateReader (that assume a Monad instance exists for F)

F

context

S

state

Linear Supertypes
StateReader[F, S], AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. StateReaderHelpers
  2. StateReader
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Abstract Value Members

  1. implicit abstract def monad: Monad[F]
  2. abstract def read: F[Option[S]]

    Read the entity state, returns None if the entity doesn't yet exist

    Read the entity state, returns None if the entity doesn't yet exist

    returns

    optional state in F context

    Definition Classes
    StateReader

Concrete Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @IntrinsicCandidate() @native()
  6. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  7. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  8. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @IntrinsicCandidate() @native()
  9. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @IntrinsicCandidate() @native()
  10. def ifKnown[Error, A](fa: (S) => A)(ifUnknown: => Error): F[\/[Error, A]]

    Convenience function which applies fa on the state if entity exists and wraps this in a Right, otherwise returns a Left with the provided error value.

    Convenience function which applies fa on the state if entity exists and wraps this in a Right, otherwise returns a Left with the provided error value.

    fa

    function to apply on state

    ifUnknown

    left value in case of missing entity

  11. def ifKnownElse[A](fa: (S) => F[A])(ifUnknownF: => F[A]): F[A]

    Convenience function which applies fa on the state if entity exists, otherwise returns a default value

    Convenience function which applies fa on the state if entity exists, otherwise returns a default value

    fa

    function to apply on state

    ifUnknownF

    value in case of missing entity in F context

  12. def ifKnownF[Error, A](fa: (S) => F[A])(ifUnknown: => Error): F[\/[Error, A]]

    Convenience function which applies fa on the state if entity exists and wraps this in a Right, otherwise returns a Left with the provided error value.

    Convenience function which applies fa on the state if entity exists and wraps this in a Right, otherwise returns a Left with the provided error value.

    fa

    function to apply on state

    ifUnknown

    left value in case of missing entity

  13. def ifKnownFE[Error, A](fa: (S) => F[\/[Error, A]])(ifUnknown: => Error): F[\/[Error, A]]

    Convenience function which applies fa on the state if entity exists, otherwise returns a Left with the provided error value.

    Convenience function which applies fa on the state if entity exists, otherwise returns a Left with the provided error value.

    fa

    function to apply on state

    ifUnknown

    left value in case of missing entity

  14. def ifKnownT[Error, A](fa: (S) => EitherT[F, Error, A])(ifUnknown: => Error): F[\/[Error, A]]

    Convenience function which applies fa on the state if entity exists and unwraps EitherT value, otherwise returns a Left with the provided error value.

    Convenience function which applies fa on the state if entity exists and unwraps EitherT value, otherwise returns a Left with the provided error value.

    fa

    function to apply on state

    ifUnknown

    left value in case of missing entity

  15. def ifUnknown[Error, A](a: => A)(ifKnown: (S) => Error): F[\/[Error, A]]

    Convenience function which returns a in a Right if entity doesn't yet exist, otherwise calls ifKnown with the state and wraps this in a Left.

    Convenience function which returns a in a Right if entity doesn't yet exist, otherwise calls ifKnown with the state and wraps this in a Left.

    ifKnown

    function to compute left value in case of existing entity

  16. def ifUnknownElse[A](fa: => F[A])(ifKnown: (S) => F[A]): F[A]

    Convenience function which returns a value fa in F context, otherwise calls ifKnown with the state

    Convenience function which returns a value fa in F context, otherwise calls ifKnown with the state

    fa

    value in case of missing entity in F context

    ifKnown

    function to apply on state

  17. def ifUnknownF[Error, A](fa: => F[A])(ifKnown: (S) => Error): F[\/[Error, A]]

    Convenience function which invokes fa if entity doesn't yet exist and wraps this in a Right, otherwise calls ifKnown with the state and wraps this in a Left.

    Convenience function which invokes fa if entity doesn't yet exist and wraps this in a Right, otherwise calls ifKnown with the state and wraps this in a Left.

    fa

    success value when entity doesn't exist yet

    ifKnown

    function to compute left value in case of existing entity

  18. def ifUnknownFE[Error, A](fa: => F[\/[Error, A]])(ifKnown: (S) => Error): F[\/[Error, A]]

    Convenience function which invokes fa if entity doesn't yet exist and wraps this in a Right, otherwise calls ifKnown with the state and wraps this in a Left.

    Convenience function which invokes fa if entity doesn't yet exist and wraps this in a Right, otherwise calls ifKnown with the state and wraps this in a Left.

    fa

    success value when entity doesn't exist yet

    ifKnown

    function to compute left value in case of existing entity

  19. def ifUnknownT[Error, A](fa: => EitherT[F, Error, A])(ifKnown: (S) => Error): F[\/[Error, A]]

    Convenience function which invokes fa if entity doesn't yet exist, otherwise calls , ifKnown with the the state and wraps this in a Left.

    Convenience function which invokes fa if entity doesn't yet exist, otherwise calls , ifKnown with the the state and wraps this in a Left.

    fa

    value wrapped in EitherT when entity doesn't exist yet

    ifKnown

    function to compute left value in case of existing entity

  20. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  21. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  22. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @IntrinsicCandidate() @native()
  23. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @IntrinsicCandidate() @native()
  24. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  25. def toString(): String
    Definition Classes
    AnyRef → Any
  26. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  27. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  28. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated
    Deprecated

    (Since version 9)

Inherited from StateReader[F, S]

Inherited from AnyRef

Inherited from Any

Ungrouped