Skip to content

Instantly share code, notes, and snippets.

@globulon
Created March 4, 2012 18:46
Show Gist options
  • Select an option

  • Save globulon/1974331 to your computer and use it in GitHub Desktop.

Select an option

Save globulon/1974331 to your computer and use it in GitHub Desktop.
Traverse
trait Traverse[C[_]] {
def traverse[M[_], T, U](source: C[T])(f: (T) ⇒ M[U])(implicit applicative: Applicative[M]): M[C[U]]
final def sequence[M[_], T](source: C[M[T]])(implicit applicative: Applicative[M]): M[C[T]] = {
traverse[M, M[T], T](source){identity}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment