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

Create summoners for specialized Readers #109

Closed
Odomontois opened this issue Jan 13, 2020 · 2 comments
Closed

Create summoners for specialized Readers #109

Odomontois opened this issue Jan 13, 2020 · 2 comments
Labels
good first issue Good for newcomers

Comments

@Odomontois
Copy link
Member

Make it possible to summon specific contextual instances via

HasContext[F, C]
HasLocal[F, C]    
HasContextRun[F, G, C]
@Odomontois Odomontois added the good first issue Good for newcomers label Jan 13, 2020
@DoSOfRedRiver
Copy link
Contributor

I currently using a solution which works like:

  trait Id
  trait Templates

  type HasTemplates[F[_]] = HasContext[F, Templates]
  type HasId[F[_]] = HasContext[F, Id]

  def example[F[_]: HasTemplates: HasId: Monad] = {
    for {
      id <- hasContext[HasId].get
      templates <- hasContext[HasTemplates].get
    } yield ()
  }

Not sure if it is good enough, though. What do you think?

Odomontois pushed a commit that referenced this issue Feb 5, 2020
@atapin
Copy link
Collaborator

atapin commented Feb 9, 2020

@Odomontois should this issue be closed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants