package sbt
object object sbt.ControlControl
{
def [T](=> String,sbt.Logger)(=> Either[String,T])Either[String,T]trap[>: Nothing <: AnyT](=> StringerrorMessagePrefix: => String, sbt.Loggerlog: sbt.LoggerLogger)(=> Either[String,T]execute: => Either[String, T]): Either[String,T]Either[String, T] =
try { => Either[String,T]execute }
catch { Left[java.lang.String,Nothing]case java.lang.Throwablee => sbt.Loggerlog.(=> Throwable)Unittrace(java.lang.Throwablee); (java.lang.String)Left[java.lang.String,Nothing]Left(=> StringerrorMessagePrefix (Any)java.lang.String+ java.lang.Throwablee.()java.lang.StringtoString) }
def [T](=> String,sbt.Logger)(=> Either[String,T])(=> Unit)Either[String,T]trapAndFinally[>: Nothing <: AnyT](=> StringerrorMessagePrefix: => String, sbt.Loggerlog: sbt.LoggerLogger)(=> Either[String,T]execute: => Either[String, T])(=> UnitdoFinally: => Unit): Either[String,T]Either[String, T] =
try { => Either[String,T]execute }
catch { Left[java.lang.String,Nothing]case java.lang.Throwablee => sbt.Loggerlog.(=> Throwable)Unittrace(java.lang.Throwablee); (java.lang.String)Left[java.lang.String,Nothing]Left(=> StringerrorMessagePrefix (Any)java.lang.String+ java.lang.Throwablee.()java.lang.StringtoString) }
finally { (sbt.Logger)(=> Unit)UnittrapAndLog(sbt.Loggerlog)(=> UnitdoFinally) }
def (=> String,sbt.Logger)(=> Option[String])Option[String]trapUnit(=> StringerrorMessagePrefix: => String, sbt.Loggerlog: sbt.LoggerLogger)(=> Option[String]execute: => Option[String]): Option[String]Option[String] =
try { => Option[String]execute }
catch { Some[java.lang.String]case java.lang.Throwablee => sbt.Loggerlog.(=> Throwable)Unittrace(java.lang.Throwablee); (java.lang.String)Some[java.lang.String]Some(=> StringerrorMessagePrefix (Any)java.lang.String+ java.lang.Throwablee.()java.lang.StringtoString) }
def (=> String,sbt.Logger)(=> Option[String])(=> Unit)Option[String]trapUnitAndFinally(=> StringerrorMessagePrefix: => String, sbt.Loggerlog: sbt.LoggerLogger)(=> Option[String]execute: => Option[String])(=> UnitdoFinally: => Unit): Option[String]Option[String] =
try { => Option[String]execute }
catch { Some[java.lang.String]case java.lang.Throwablee => sbt.Loggerlog.(=> Throwable)Unittrace(java.lang.Throwablee); (java.lang.String)Some[java.lang.String]Some(=> StringerrorMessagePrefix (Any)java.lang.String+ java.lang.Throwablee.()java.lang.StringtoString) }
finally { (sbt.Logger)(=> Unit)UnittrapAndLog(sbt.Loggerlog)(=> UnitdoFinally) }
def (=> Unit)Unittrap(=> Unitexecute: => Unit)
{
try { => Unitexecute }
catch { Unitcase Exceptione: ExceptionException => Unit() }
}
def (sbt.Logger)(=> Unit)UnittrapAndLog(sbt.Loggerlog: sbt.LoggerLogger)(=> Unitexecute: => Unit)
{
try { => Unitexecute }
catch { Unitcase java.lang.Throwablee => sbt.Loggerlog.(=> Throwable)Unittrace(java.lang.Throwablee); sbt.Loggerlog.(=> String)Uniterror(java.lang.Throwablee.()java.lang.StringtoString) }
}
def [T](=> T)Either[Exception,T]convertException[>: Nothing <: AnyT](=> Tt: => T): Either[Exception,T]Either[Exception, T] =
{
try { (T)Right[Nothing,T]Right(=> Tt) }
catch { Left[Exception,Nothing]case Exceptione: ExceptionException => (Exception)Left[Exception,Nothing]Left(Exceptione) }
}
def [T](sbt.Logger)(=> T)Either[String,T]convertErrorMessage[>: Nothing <: AnyT](sbt.Loggerlog: sbt.LoggerLogger)(=> Tt: => T): Either[String,T]Either[String, T] =
{
try { (T)Right[Nothing,T]Right(=> Tt) }
catch { Left[java.lang.String,Nothing]case Exceptione: ExceptionException => sbt.Loggerlog.(=> Throwable)Unittrace(Exceptione); (java.lang.String)Left[java.lang.String,Nothing]Left(Exceptione.()java.lang.StringtoString) }
}
final def [T](List[T])((T) => Option[String])Option[String]lazyFold[>: Nothing <: AnyT](List[T]list: List[T]List[T])((T) => Option[String]f: T => Option[String]): Option[String]Option[String] =
List[T]list Option[String]match
{
None.typecase object NilNil => object NoneNone
Option[String]case Thead :: List[T]tail =>
(T)Option[String]f(Thead) Option[String]match
{
Option[String]case object NoneNone => (List[T])((T) => Option[String])Option[String]lazyFold(List[T]tail)((T) => Option[String]f)
Option[String]case Option[String]x => Option[String]x
}
}
final def [T, S](List[T],S)((S, T) => Either[String,S])Either[String,S]lazyFold[>: Nothing <: AnyT, >: Nothing <: AnyS](List[T]list: List[T]List[T], Svalue: SS)((S, T) => Either[String,S]f: (S,T) => Either[String, S]): Either[String,S]Either[String, S] =
List[T]list Either[String,S]match
{
Right[Nothing,S]case object NilNil => (S)Right[Nothing,S]Right(Svalue)
Either[String,S]case Thead :: List[T]tail =>
(S,T)Either[String,S]f(Svalue, Thead) Either[String,S]match
{
Either[String,S]case Right(SnewValue) => (List[T],S)((S, T) => Either[String,S])Either[String,S]lazyFold(List[T]tail, SnewValue)((S, T) => Either[String,S]f)
Either[String,S]case Either[String,S]x => Either[String,S]x
}
}
def [T](Either[String,T])((T) => Option[String])Option[String]thread[>: Nothing <: AnyT](Either[String,T]e: Either[String,T]Either[String, T])((T) => Option[String]f: T => Option[String]): Option[String]Option[String] =
Either[String,T]e.=> Either.RightProjection[String,T]right.((T) => Either[String,Unit])Either[String,Unit]flatMap( Tt => (T)Option[String]f(Tt).(=> Unit)Either[String,Unit] with ProducttoLeft(Unit()) ).=> Either.LeftProjection[String,Unit]left.=> Option[String]toOption
}