All Downloads are FREE. Search and download functionalities are using the official Maven repository.

dotty.tools.repl.results.scala Maven / Gradle / Ivy

There is a newer version: 3.6.4-RC1-bin-20241220-0bfa1af-NIGHTLY
Show newest version
package dotty.tools
package repl

import dotc.reporting.Diagnostic

/** Contains the different data and type structures used to model results
 *  in the REPL
 */
object results {

  /** Type alias for `List[Diagnostic]` */
  type Errors = List[Diagnostic]

  /** Result is a type alias for an Either with left value `Errors` */
  type Result[+A] = scala.util.Either[Errors, A]

  extension [A](a: A)
    def result: Result[A] = scala.util.Right(a)

  extension [A](xs: Errors)
    def errors: Result[A] = scala.util.Left(xs)

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy