Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Context accessor method #540

Merged
merged 1 commit into from
Mar 6, 2021
Merged

Context accessor method #540

merged 1 commit into from
Mar 6, 2021

Conversation

oskin1
Copy link
Collaborator

@oskin1 oskin1 commented Mar 4, 2021

Helper method allowing to access dependencies in context in slightly more convenient way when there are multiple of them:

import tofu.syntax.context._
def foo[F[_]: Monad: Foo.Has: Bar.Has]: F[X] =
  (hasContext[F, Foo], hasContext[F, Bar]).mapN((f, b) => ???)

vs

def foo[F[_]: Monad: Foo.Has: Bar.Has]: F[X] =
  (Foo.access, Bar.access).mapN((f, b) => ???)

@Odomontois Odomontois merged commit d628557 into master Mar 6, 2021
@Odomontois Odomontois deleted the context-access branch July 1, 2021 08:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants