object WithContext
Companion object for WithContext
Linear Supertypes
Ordering
- Alphabetic
- By Inheritance
Inherited
- WithContext
- AnyRef
- Any
- Hide All
- Show All
Visibility
- Public
- Protected
Type Members
- trait Companion[C] extends ContextInstances1[C]
A mix-in for supplying environment data type companions with useful things
A mix-in for supplying environment data type companions with useful things
@ClassyOptics case class MyContext(id: Int, date: String) object MyContext extends Context.Companion[MyContext]
Example: - trait ContextInstances1[C] extends AnyRef
- trait ContextInstances2[C] extends AnyRef
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
- def apply[F[_], C](implicit ctx: WithContext[F, C]): WithContext[F, C]
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native() @IntrinsicCandidate()
- def const[F[_], C](c: C)(implicit arg0: Applicative[F]): WithContext[F, C]
Creates constant Context of type C in F
Creates constant Context of type C in F
Allows to put some value into context of F even when F itself does not have any way to store it
case class MyCtx(id: Int) val program: Option[String] = { implicit val ctx = Context.const[Option, MyCtx](MyCtx(3)) Context[Option].ask(ctx => ctx.id.toString) }
Example: - final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @IntrinsicCandidate()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @IntrinsicCandidate()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def make[F[_], A](fa: F[A])(implicit arg0: Functor[F]): WithContext[F, A]
Same as const but context is effectual here
Same as const but context is effectual here
def handleRequest[F[_]: Monad: *[_] WithContext TraceId](httpRequest: Request) = ??? def myProgram[F[_]: Monad] = for { request <- getRequest[F] implicit0(ctx: TraceId In F) <- Context.make(genTraceId[F]) _ <- handleRequest[F](request) } yield ()
Example: - final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @IntrinsicCandidate()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @IntrinsicCandidate()
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
Deprecated Value Members
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable]) @Deprecated
- Deprecated