Trait

scalaz.zio

App

Related Doc: package zio

Permalink

trait App extends RTS

The entry point for a purely-functional application on the JVM.

import java.io.IOException
import scalaz.zio.{App, IO}
import scalaz.zio.console._

object MyApp extends App {

final def run(args: List[String]): IO[Nothing, ExitStatus] =
    myAppLogic.attempt.map(_.fold(_ => 1, _ => 0)).map(ExitStatus.ExitNow(_))

  def myAppLogic: IO[IOException, Unit] =
    for {
      _ <- putStrLn("Hello! What is your name?")
      n <- getStrLn
      _ <- putStrLn("Hello, " + n + ", good to meet you!")
    } yield ()
}
Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. App
  2. RTS
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. sealed abstract class ExitStatus extends Serializable with Product

    Permalink

Abstract Value Members

  1. abstract def run(args: List[String]): IO[Nothing, ExitStatus]

    Permalink

    The main function of the application, which will be passed the command-line arguments to the program and has to return an IO with the errors fully handled.

Concrete Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. object ExitStatus extends Serializable

    Permalink
  5. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  6. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  7. lazy val env: Env

    Permalink
    Definition Classes
    RTS
  8. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  9. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  10. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  11. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  12. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  13. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  14. final def main(args0: Array[String]): Unit

    Permalink

    The Scala main function, intended to be called only by the Scala runtime.

  15. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  16. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  17. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  18. final def shutdown(): Unit

    Permalink
    Definition Classes
    RTS
  19. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  20. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  21. final def unsafeRun[E, A](io: IO[E, A]): A

    Permalink
    Definition Classes
    RTS
  22. final def unsafeRunAsync[E, A](io: IO[E, A])(k: (Exit[E, A]) ⇒ Unit): Unit

    Permalink
    Definition Classes
    RTS
  23. final def unsafeRunSync[E, A](io: IO[E, A]): Exit[E, A]

    Permalink
    Definition Classes
    RTS
  24. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  25. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  26. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from RTS

Inherited from AnyRef

Inherited from Any

Ungrouped