|
Scala example source code file (SafeApp.scala)
The SafeApp.scala Scala example source codepackage scalaz package effect import IO._ /** * A safe alternative to the `App` trait in the Scala standard library. This * trait provides an implementation of the `main` method by calling * `unsafePerformIO` on a specified `IO` action. */ trait SafeApp { def run(args: ImmutableArray[String]): IO[Unit] = runl(args.toList) def runl(args: List[String]): IO[Unit] = runc def runc: IO[Unit] = ioUnit final def main(args: Array[String]) { run(ImmutableArray.fromArray(args)).unsafePerformIO() } } Other Scala examples (source code examples)Here is a short list of links related to this Scala SafeApp.scala source code file: |
... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
Copyright 1998-2024 Alvin Alexander, alvinalexander.com
All Rights Reserved.
A percentage of advertising revenue from
pages under the /java/jwarehouse
URI on this website is
paid back to open source projects.