name.rayrobdod.stringContextParserCombinator
A library for implementing custom string interpolation implementations using Parser Combinators
Attributes
Members list
Packages
Implicit values used by branch combinators that allow combinations of input types to have more ergonomic return types.
Implicit values used by branch combinators that allow combinations of input types to have more ergonomic return types.
Each of the typeclasses defined in this package fit into a matrix, where one dimension is which type of parser the typeclass is used with and the other dimension is the method that uses an instance of the type
method | Covariant (Interpolator) | Contravariant (Extractor) | Invariant (Parser) |
---|---|---|---|
andThen |
Sequenced | ContraSequenced | BiSequenced |
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.
Each of these traits has a companion object that defines a generic instance of the trait, and a few instances for more specific types. For instance, each typeclass includes a instance that will avoid wrapping scala.Unit
values in a collection or tuple.
Defining custom instances of these types is supported. Making custom given instances can significantly reduce the number of explicit map
calls required when writing a parser, however the usual advice with given instances applies: keep types specific, or keep the scope of a given instance to the minimum viable to prevent given instances from becoming confusing.
Attributes
Type members
Classlikes
Represents a unicode codepoint
Represents a unicode codepoint
Attributes
- Companion
- object
- Source
- CodePoint.scala
- Supertypes
-
class Objecttrait Matchableclass Any
Attributes
- Companion
- class
- Source
- CodePoint.scala
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
CodePoint.type
Parses an interpolated string expression into some extractor
Parses an interpolated string expression into some extractor
Type parameters
- A
-
the type of the parsed result
- Expr
-
the macro-level expression type
- Type
-
the macro-level type type
Attributes
- Companion
- object
- Source
- Extractor.scala
- Supertypes
-
class Objecttrait Matchableclass Any
Attributes
- Companion
- class
- Source
- Extractor.scala
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
Extractor.type
Parses an interpolated string expression into some value
Parses an interpolated string expression into some value
Type parameters
- A
-
the type of the parsed result
- Expr
-
the macro-level expression type.
Attributes
- Companion
- object
- Source
- Interpolator.scala
- Supertypes
-
class Objecttrait Matchableclass Any
Attributes
- Companion
- class
- Source
- Interpolator.scala
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
Interpolator.type
Support for Interpolator.lifted; represents a macro-level function that combines a CC[A] and an A.
Support for Interpolator.lifted; represents a macro-level function that combines a CC[A] and an A.
Attributes
- Source
- package.scala
- Supertypes
-
class Objecttrait Matchableclass Any
Thrown by Id-using parse methods when the parser fails to parse the string context
Thrown by Id-using parse methods when the parser fails to parse the string context
The Expr-using parse methods will fail at compile time instead, and thus don't throw
Attributes
- Source
- ParseException.scala
- Supertypes
-
class RuntimeExceptionclass Exceptionclass Throwabletrait Serializableclass Objecttrait Matchableclass AnyShow all
Parses an interpolated string expression into some value
Parses an interpolated string expression into some value
Type parameters
- A
-
the type of the parsed result
- Expr
-
the macro-level expression type
- Type
-
the macro-level type type
Attributes
- Companion
- object
- Source
- Parser.scala
- Supertypes
-
class Objecttrait Matchableclass Any
Attributes
- Companion
- class
- Source
- Parser.scala
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
Parser.type
A partial function which is valid according to an Expr[Boolean]
instead of a plain Boolean
A partial function which is valid according to an Expr[Boolean]
instead of a plain Boolean
Attributes
- Companion
- object
- Source
- PartialExprFunction.scala
- Supertypes
-
class Objecttrait Matchableclass Any
Attributes
- Companion
- trait
- Source
- PartialExprFunction.scala
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
PartialExprFunction.type
Describes how much a Repeat will attempt to match
An object that can be a pattern match pattern
An object that can be a pattern match pattern
Attributes
- Companion
- object
- Source
- Unapply.scala
- Supertypes
-
class Objecttrait Matchableclass Any
- Known subtypes
-
trait Zero[A]
The types of pattern match objects
The types of pattern match objects
Attributes
- Companion
- trait
- Source
- Unapply.scala
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
Unapply.type
Types
An identity context - for parsing outside of a macro
An identity function for lifting into the identity context