Last active
September 4, 2018 07:15
-
-
Save alexandru/e45231fddb42c77c830695aadaf6dbb9 to your computer and use it in GitHub Desktop.
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
import IOApp.Runtime | |
trait IOApp { | |
// Implicit extractor | |
implicit final def contextShift(implicit r: Runtime): ContextShift[IO] = | |
r.contextShift | |
// Implicit extractor | |
implicit final def timer(implicit r: Runtime): Timer[IO] = | |
r.timer | |
def run(args: List[String])(implicit r: Runtime): IO[ExitCode] | |
// ... | |
} | |
object IOApp { | |
trait Runtime { | |
def executionContext: ExecutionContext | |
def timer: Timer[IO] | |
def contextShift: ContextShift[IO] | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment