Skip to content

Instantly share code, notes, and snippets.

View matthughes's full-sized avatar

Matt Hughes matthughes

View GitHub Profile
@pchiusano
pchiusano / retries.scala
Last active December 30, 2015 22:29
Combinator for retrying a `Process` multiple times, delaying between attempts
// FYI: some comments below refer to old version of this gist: https://gist.github.com/pchiusano/7894696/12201b92db57dff8ed6689fc55c15c3f1a136f86
package scalaz.stream
import scalaz.\/
import scalaz.concurrent.Task
object retries {
def dropWhileUnlessAtEnd[I](f: I => Boolean): Process1[I,I] = {
def go(prev: Option[I]): Process1[I,I] =