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

Traverse instance for Eff #86

Closed
edmundnoble opened this issue Mar 31, 2017 · 2 comments
Closed

Traverse instance for Eff #86

edmundnoble opened this issue Mar 31, 2017 · 2 comments

Comments

@edmundnoble
Copy link
Contributor

I think we should be able to provide a Traverse instance for Eff[S, A], given that all of the members of S have Traverse instances; by this I mean that all of them are possible to run without detach.

@etorreborre
Copy link
Member

How would you write the type signature?

implicit def effTraverse[R : TraverseFx]: Traverse[Eff[R, ?]] = new Traverse[Eff[R, ?]] {
  def traverse[G[_]: Applicative, A, B](fa: Eff[R, A])(f: A => G[B]): G[Eff[R, B]] = ???
}

/**
 * can we get the Traverse instances for individual effects like that?
 */
trait TraverseFx[R <: Fx] {
  type H[_] <: Fx
  type T <: Fx

  def traverse: Traverse[H]
  def traverseFx: TraverseFx[T]
}

@etorreborre
Copy link
Member

I'm closing this for now, please re-open if there is some interest again.

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

No branches or pull requests

2 participants