Skip to content

Instantly share code, notes, and snippets.

@globulon
Created March 31, 2012 18:15
Show Gist options
  • Select an option

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

Select an option

Save globulon/2267304 to your computer and use it in GitHub Desktop.
Use of sequence
def replicateM[T, M[_]: Applicative, C[_]: MonoidC : Traverse](a: M[T], n: Int): M[C[T]] = {
implicitly[Traverse[C]].sequence(a.replicate(n))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment