Skip to content

Commit

Permalink
fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! Redesi…
Browse files Browse the repository at this point in the history
…gn context implementation

address PR feedback: add AskContext, move VaultContext, rename Ops to ContextOps
  • Loading branch information
NthPortal committed Aug 31, 2023
1 parent 22aecd1 commit 2d38a8b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ trait Context[C] { outer =>
/** The root context, from which all other contexts are derived. */
def root: C

class Ops(ctx: C) {
class ContextOps(ctx: C) {

/** Retrieves the value associated with the given key from the context, if
* such a value exists.
Expand Down Expand Up @@ -70,7 +70,7 @@ object Context {
def apply[C](implicit c: Context[C]): Context[C] = c

object Implicits {
implicit def mkOps[C](ctx: C)(implicit c: Context[C]): c.Ops =
new c.Ops(ctx)
implicit def mkOps[C](ctx: C)(implicit c: Context[C]): c.ContextOps =
new c.ContextOps(ctx)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@

package org.typelevel.otel4s.java

import cats.mtl.Ask
import cats.mtl.Local

package object context {
type AskContext[F[_]] = Ask[F, Context]
type LocalContext[F[_]] = Local[F, Context]
}

0 comments on commit 2d38a8b

Please sign in to comment.