Predefined implicit implementations of Eithered and methods to create new Eithereds
Attributes
- Companion
- trait
- Source
- Eithered.scala
- Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
Eithered.type
Members list
Value members
Concrete methods
Constructs an Eithered
from a set of functions corresponding to each of Eithered's methods
Constructs an Eithered
from a set of functions corresponding to each of Eithered's methods
Attributes
- Source
- Eithered.scala
An Eithered that wraps the value in a scala.Either
An Eithered that wraps the value in a scala.Either
Attributes
- Example
-
In the following interpolator, even digits are placed in a Left while odd digits are placed in a Right
import name.rayrobdod.stringContextParserCombinator.Interpolator.idInterpolators._ import name.rayrobdod.stringContextParserCombinator.typeclass.Eithered val evenOdd:Interpolator[Either[Char, Char]] = charIn("02468").orElse(charIn("13579"))(using Eithered.discriminatedUnion) evenOdd.interpolate(StringContext("4"), Nil) // Left(4): Either[Char, Char] evenOdd.interpolate(StringContext("7"), Nil) // Right(7): Either[Char, Char]
- Source
- Eithered.scala
Givens
Inherited givens
Attributes
- Inherited from:
- VersionSpecificEithered (hidden)
- Source
- VersionSpecificEithered.scala
The fallback Eithered; creates a union type of the two component types.
The fallback Eithered; creates a union type of the two component types.
Since the union of a type with itself is equivalent to that same type, if this Eithered is used for two parsers of the same type, then the result is a parser of that type.
Attributes
- Inherited from:
- LowPrioEithered (hidden)
- Source
- VersionSpecificEithered.scala
Attributes
- Inherited from:
- VersionSpecificEithered (hidden)
- Source
- VersionSpecificEithered.scala