Definitions

trait Definitions[Pipe[_, _], In, Out]

Contains definitions that could be shared between Scala 2 and Scala 3 implementation of the derivation logic, which aren't strictly related to code parsing and generation.

Type parameters:
In

input type of the type class we are deriving

Out

output type of the type class we are deriving

Pipe

the type class that we are deriving for

Companion:
object
class Object
trait Matchable
class Any
trait PlatformDefinitions[Pipe, In, Out]
class MacrosImpl[Pipe, In, Out]
Definitions[Pipe, In, Out]

Type members

Classlikes

Companion:
class
sealed trait ConfigEntry extends Product with Serializable

Possible configuration options that we can work with inside a macro. Parsed from pipez.PipeDerivationConfig

Possible configuration options that we can work with inside a macro. Parsed from pipez.PipeDerivationConfig

Companion:
object
Companion:
class
sealed trait DerivationError extends Product with Serializable

Possible errors that can happen during derivation

Possible errors that can happen during derivation

Companion:
object
Companion:
class
sealed trait DerivationResult[+A] extends Product with Serializable

Helper which allows: use of for-comprehension, parallel error composition, logging

Helper which allows: use of for-comprehension, parallel error composition, logging

Companion:
object
object Path
Companion:
class
sealed trait Path extends Product with Serializable

Type representing how we got the specific value from the in: In argument

Type representing how we got the specific value from the in: In argument

Companion:
object
final class Settings(entries: List[ConfigEntry])

Collection of config options obtained after parsing pipez.PipeDerivationConfig

Collection of config options obtained after parsing pipez.PipeDerivationConfig

Types

type Expr[A]

Platform-specific expression representation (c.universe.Expr[A] in 2, quotes.Expr[A] in 3

Platform-specific expression representation (c.universe.Expr[A] in 2, quotes.Expr[A] in 3

type Type[A]

Platform-specific type representation (c.universe.Type in 2, scala.quoted.Type[A] in 3)

Platform-specific type representation (c.universe.Type in 2, scala.quoted.Type[A] in 3)

Value members

Abstract methods

def pathCode(path: Path): Expr[Path]

Translates Path as seen in macro to runtime value we can pass to updateContext`

Translates Path as seen in macro to runtime value we can pass to updateContext`

def previewCode[A](code: Expr[A]): String

Allows displaying the generated code in platform-independent way

Allows displaying the generated code in platform-independent way

Like previewCode(pipeDerivation) but allowing hiding some shenanigans we do

Like previewCode(pipeDerivation) but allowing hiding some shenanigans we do

def previewType[A : Type]: String

Prints type value

Prints type value

Turns the code defining PipeDerivationConfig[Pipe, In, Out] into Settings.

Turns the code defining PipeDerivationConfig[Pipe, In, Out] into Settings.

Requires that config is created as one chain while passing the parameter.

def singleAbstractMethodExpansion[SAM : Type](code: Expr[SAM]): Expr[SAM]

If we pass Single Abstract Method as argument, after expansion inference sometimes fails, compiler might need a hint

If we pass Single Abstract Method as argument, after expansion inference sometimes fails, compiler might need a hint

def summonPipe[Input : Type, Output : Type]: DerivationResult[Expr[Pipe[Input, Output]]]

Allows summoning the type class in platform-independent way

Allows summoning the type class in platform-independent way

Concrete methods

final def readSettingsIfGiven(code: Option[Expr[PipeDerivationConfig[Pipe, In, Out]]]): DerivationResult[Settings]

Reads configs if passed, or fallback to defaults (empty Settings) otherwise

Reads configs if passed, or fallback to defaults (empty Settings) otherwise

def typeOf[A](implicit tpe: Type[A]): Type[A]

Summons Type independently of the platform

Summons Type independently of the platform

Abstract fields

Value of PipeDerivation[Pipe], which was passed to macro as (most likely) implicit

Value of PipeDerivation[Pipe], which was passed to macro as (most likely) implicit

Implicits

Implicits

implicit val In: Type[In]

Provides Type instance for In

Provides Type instance for In

implicit val Out: Type[Out]

Provides Type instance for Out

Provides Type instance for Out

implicit def PipeOf[I : Type, O : Type]: Type[Pipe[I, O]]

Provides Type instance for Pipe[I, O]

Provides Type instance for Pipe[I, O]