Skip to content

Instantly share code, notes, and snippets.

@eamelink
Last active July 27, 2016 14:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eamelink/8852888f487429b3f92aea686bc50770 to your computer and use it in GitHub Desktop.
Save eamelink/8852888f487429b3f92aea686bc50770 to your computer and use it in GitHub Desktop.
Dependent tasks
// Can we implement `dependentTasks` in a functional way?
// Is it a terrible idea to implement this? Why?
def dependentTasks: (String => Task[String], String => Task[String]) = ???
val (f1, f2) = dependentTasks
val t1 = f1("foo")
val t2 = f2("bar")
assert(t1.unsafeRun == "foo-bar")
assert(t2.unsafeRun == "bar-foo")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment