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

caseapp.core.parser.EitherParser.scala Maven / Gradle / Ivy

There is a newer version: 2.0.0-M8
Show newest version
package caseapp.core.parser

import caseapp.core.{Arg, Error}

final case class EitherParser[T, D0](underlying: Parser.Aux[T, D0]) extends Parser[Either[Error, T]] {

  type D = D0

  def init = underlying.init

  def step(args: List[String], d: D): Either[(Error, List[String]), Option[(D, List[String])]] =
    underlying.step(args, d)

  def get(d: D): Right[Error, Either[Error, T]] =
    Right(underlying.get(d))

  def args: Seq[Arg] =
    underlying.args

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy