Skip to content

Commit

Permalink
[base] Documentation improvments
Browse files Browse the repository at this point in the history
  • Loading branch information
rayrobdod committed Nov 28, 2024
1 parent f783cd4 commit d6760c6
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 2 deletions.
3 changes: 3 additions & 0 deletions Base/src/main/scala-3/typeclass/VersionSpecificEithered.scala
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ private[typeclass] trait VersionSpecificEithered extends LowPrioEithered {
given unitAny[B, Z](using ev:Optionally[B, Z]):Eithered[Unit, B, Z] = Eithered(_ => ev.none, ev.some _)
given anyUnit[A, Z](using ev:Optionally[A, Z]):Eithered[A, Unit, Z] = Eithered(ev.some _, _ => ev.none)

/**
* @since 0.1.1
*/
def quotedSplicePiece[A]: Eithered[Expr[A], Expr[Iterable[A]], Repeated.SplicePiece[Expr, A]] =
Eithered(new Repeated.SplicePiece.One(_), new Repeated.SplicePiece.Many(_))
}
Expand Down
2 changes: 1 addition & 1 deletion Base/src/main/scala/UnapplyExpr.scala
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package name.rayrobdod.stringContextParserCombinator
import scala.reflect.ClassTag

/**
* The data needed to create am Unapply
* The data needed to create an Unapply
*/
private[stringContextParserCombinator]
final case class UnapplyExpr[+Expr[_], +Type[_], -A] (
Expand Down
2 changes: 2 additions & 0 deletions Base/src/main/scala/typeclass/Repeated.scala
Original file line number Diff line number Diff line change
Expand Up @@ -177,10 +177,12 @@ object Repeated extends VersionSpecificRepeated with LowPrioRepeated {
idFromSplicesUsingBuilder(() => List.newBuilder)

/**
* Represents either zero items, one item or a sequence of items.
* @version 0.1.1
*/
sealed trait SplicePiece[Expr[+_], +A]
/**
* The [[SplicePiece]] cases
* @version 0.1.1
*/
object SplicePiece {
Expand Down
1 change: 1 addition & 0 deletions Base/src/main/scala/typeclass/package.scala
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ package name.rayrobdod.stringContextParserCombinator
* | `orElse` | [[Eithered]] | [[ContraEithered]] | [[BiEithered]] |
* | `repeat` | [[Repeated]] | [[ContraRepeated]] | [[BiRepeated]] |
* | `optionally` | [[Optionally]] | [[ContraOptionally]] | [[BiOptionally]] |
* | `mapToExpr` | [[ToExprMapping]] | N/A | N/A |
*
* Thus, if you are only working with interpolators, then you'll only need to work with the unprefixed typeclasses.
*
Expand Down
2 changes: 1 addition & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* `quotedConcatenateString` for scala-3 quoted context
* Add `Repeat.SplicePiece`; representing either zero, one, or many items; and typeclass instances using `SplicePiece`
* for scala-2 macro context:
* `Either.forContextSplicePiece` to combine a `Interpolator[c.Expr[A]]` and a `Interpolator[c.Expr[List[A]]]` into a `Interpolator[SplicePiece[c.Expr, A]]`
* `Either.forContext().splicePiece` to combine a `Interpolator[c.Expr[A]]` and a `Interpolator[c.Expr[List[A]]]` into a `Interpolator[SplicePiece[c.Expr, A]]`
* `Repeated.forContextFromSplicesToExprList` to splice the SplicePieces together into a `c.Expr[List[A]]`
* `Repeated.forContextFromSplicesUsingBuilder` to splice the SplicePieces together using a arbitrary Builder
* for scala-3 quoted context:
Expand Down

0 comments on commit d6760c6

Please sign in to comment.