Skip to content

Instantly share code, notes, and snippets.

@thedebugger
Created September 12, 2016 18:21
Show Gist options
  • Save thedebugger/941a059d2b079224e9845e8802da459a to your computer and use it in GitHub Desktop.
Save thedebugger/941a059d2b079224e9845e8802da459a to your computer and use it in GitHub Desktop.
monadic file exists?
def fileExists?(Dir: String): Task[Boolean] = {
val task: Stream[Task, Boolean] =
fs2.io.file.readAll[Task](Paths.get(dir, "default.nix"), 4096)
exists ( _ => true )
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment