Created
March 4, 2012 18:46
-
-
Save globulon/1974331 to your computer and use it in GitHub Desktop.
Traverse
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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