diff --git a/core/shared/src/main/scala/cats/parse/Parser.scala b/core/shared/src/main/scala/cats/parse/Parser.scala index 0bed8f7d..fa35a65e 100644 --- a/core/shared/src/main/scala/cats/parse/Parser.scala +++ b/core/shared/src/main/scala/cats/parse/Parser.scala @@ -1585,9 +1585,9 @@ object Parser { case _ => Impl.SoftProd(first, second) } - /** - * This implements the main method from the Align typeclass - */ + /** This implements the main method from the Align typeclass. This parses the first then maybe the + * second, or just the second. Put another way, it parses at least one of the arguments. + */ def align[A, B](pa: Parser[A], pb: Parser[B]): Parser[Ior[A, B]] = { val hasA = (pa ~ pb.?) .map { @@ -1600,9 +1600,9 @@ object Parser { hasA | onlyB } - /** - * This implements the main method from the Align typeclass - */ + /** This implements the main method from the Align typeclass This parses the first then maybe the + * second, or just the second. Put another way, it parses at least one of the arguments. + */ def align0[A, B](pa: Parser0[A], pb: Parser0[B]): Parser0[Ior[A, B]] = { val hasA = (pa ~ pb.?) .map { diff --git a/core/shared/src/test/scala/cats/parse/ParserTest.scala b/core/shared/src/test/scala/cats/parse/ParserTest.scala index fc971898..f6274220 100644 --- a/core/shared/src/test/scala/cats/parse/ParserTest.scala +++ b/core/shared/src/test/scala/cats/parse/ParserTest.scala @@ -3073,14 +3073,14 @@ class ParserTest extends munit.ScalaCheckSuite { case Left(a) => Left(Left(a)) case Right(bc) => bc match { - case Left(b) => Left(Right(b)) - case Right(c) => Right(c) + case Left(b) => Left(Right(b)) + case Right(c) => Right(c) case Both(b, c) => Both(Right(b), c) } case Both(a, bc) => bc match { - case Left(b) => Left(Both(a, b)) - case Right(c) => Both(Left(a), c) + case Left(b) => Left(Both(a, b)) + case Right(c) => Both(Left(a), c) case Both(b, c) => Both(Both(a, b), c) } } @@ -3088,7 +3088,6 @@ class ParserTest extends munit.ScalaCheckSuite { property("align is associative") { forAll(ParserGen.gen, ParserGen.gen, ParserGen.gen, arbitrary[String]) { (a, b, c, str) => - val alignInst = cats.Align[Parser] import alignInst.align @@ -3101,7 +3100,6 @@ class ParserTest extends munit.ScalaCheckSuite { property("align0 is associative") { forAll(ParserGen.gen0, ParserGen.gen0, ParserGen.gen0, arbitrary[String]) { (a, b, c, str) => - val alignInst = cats.Align[Parser0] import alignInst.align