MacrosImpl
Type members
Inherited classlikes
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
- Inherited from:
- Definitions
Possible errors that can happen during derivation
Possible errors that can happen during derivation
- Inherited from:
- Definitions
Helper which allows: use of for-comprehension, parallel error composition, logging
Helper which allows: use of for-comprehension, parallel error composition, logging
- Inherited from:
- Definitions
Stores information from what pieces Out
is made
Stores information from what pieces Out
is made
- Inherited from:
- SumCaseGeneration
Final platform-independent result of matching inputs with outputs using resolved strategies
Final platform-independent result of matching inputs with outputs using resolved strategies
- Inherited from:
- SumCaseGeneration
Translation strategy for a particular input subtype
Translation strategy for a particular input subtype
- Inherited from:
- SumCaseGeneration
Value generation strategy for a particular output parameter/setter
Value generation strategy for a particular output parameter/setter
- Inherited from:
- ProductCaseGeneration
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
- Inherited from:
- Definitions
Final platform-independent result of matching inputs with outputs using resolved strategies
Final platform-independent result of matching inputs with outputs using resolved strategies
- Inherited from:
- ProductCaseGeneration
Stores information how each attribute/getter could be extracted from In
value
Stores information how each attribute/getter could be extracted from In
value
- Inherited from:
- ProductCaseGeneration
Stores information how Out
value could be constructed from values of constructor parameters/passed to setters
Stores information how Out
value could be constructed from values of constructor parameters/passed to setters
- Inherited from:
- ProductCaseGeneration
Collection of config options obtained after parsing pipez.PipeDerivationConfig
Collection of config options obtained after parsing pipez.PipeDerivationConfig
- Inherited from:
- Definitions
Inherited types
Should create Out
expression from the constructor arguments grouped in parameter lists
Should create Out
expression from the constructor arguments grouped in parameter lists
- Inherited from:
- ProductCaseGeneration
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
- Inherited from:
- PlatformDefinitions
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)
- Inherited from:
- PlatformDefinitions
Value members
Inherited methods
Check is A =:= B
in a platform-independent code
Check is A =:= B
in a platform-independent code
- Inherited from:
- PlatformSumCaseGeneration
Derives using Settings
parsed from PipeDerivationConfig[Pipe, In, Out]
expression
Derives using Settings
parsed from PipeDerivationConfig[Pipe, In, Out]
expression
- Inherited from:
- Generators
Generate message to be displayed by macro on INFO level (if requested by config)
Generate message to be displayed by macro on INFO level (if requested by config)
- Inherited from:
- Generators
Generates error message to be returned from macro on ERROR level
Generates error message to be returned from macro on ERROR level
- Inherited from:
- Generators
Platform-specific way of parsing In
data
Platform-specific way of parsing In
data
Should:
- obtain a lift of subtypes OR enumeration values
- form it into
EnumData[In]
- Inherited from:
- PlatformSumCaseGeneration
Platform-specific way of parsing Out
data
Platform-specific way of parsing Out
data
Should:
- obtain a lift of subtypes OR enumeration values
- form it into
EnumData[In]
- Inherited from:
- PlatformSumCaseGeneration
Platform-specific way of parsing In
data
Platform-specific way of parsing In
data
Should:
- obtain all methods which are Scala's getters (vals, nullary defs)
- obtain all methods which are Java Bean getters (starting with is- or get-)
- for each create an
InField
factory which takesIn
argument and returnsInField
expression - form obtained collection into
ProductInData
- Inherited from:
- PlatformProductCaseGeneration
Platform-specific way of parsing Out
data
Platform-specific way of parsing Out
data
Should:
- verify whether output is a case class, a case object or a Java Bean
- obtain respectively:
- a constructor taking all arguments
- expression containing case object value
- a default constructor and collection of setters respectively
- form obtained data into
ProductOutData
- Inherited from:
- PlatformProductCaseGeneration
Platform-specific way of generating code from resolved information
Platform-specific way of generating code from resolved information
For subtype input should generate code like:
pipeDerivation.lift { (in: In, ctx: pipeDerivation.Context) =>
in match {
case inSubtype: In.Foo => pipeDerivation.unlift(fooPipe, inSubtype, updateContext(ctx, path))
case inSubtype: In.Bar => pipeDerivation.unlift(barPipe, inSubtype, updateContext(ctx, path))
}
}
- Inherited from:
- PlatformSumCaseGeneration
Platform-specific way of generating code from resolved information
Platform-specific way of generating code from resolved information
For case class output should generate code like:
pipeDerivation.lift { (in: In, ctx: pipeDerivation.Context) =>
pipeDerivation.mergeResult(
ctx,
pipeDerivation.mergeResult(
ctx,
pipeDerivation.pure(Array[Any](2)),
pipeDerivation.unlift(fooPipe, in.foo, pipeDerivation.updateContext(ctx, Path.root.field("foo"))),
{ (left, right) =>
left(0) = right
left
}
),
pipeDerivation.unlift(barPipe, in.bar, pipeDerivation.updateContext(ctx, Path.root.field("bar"))),
{ (left, right) =>
left(1) = right
new Out(
foo = left(0).asInstanceOf[Foo2],
bar = left(1).asInstanceOf[Bar2],
)
}
)
}
For case object output should generate code like:
pipeDerivation.lift { (in: In, ctx: pipeDerivation.Context) =>
pipeDerivation.pure(CaseObject)
}
For Java Bean should generate code like:
pipeDerivation.lift { (in: In, ctx: pipeDerivation.Context) =>
pipeDerivation.mergeResult(
ctx,
pipeDerivation.mergeResult(
ctx,
pipeDerivation.pure {
val result = new Out()
result
},
pipeDerivation.unlift(fooPipe, in.foo, pipeDerivation.updateContext(ctx, Path.root.field("foo"))),
{ (left, right) =>
left.setFoo(right)
left
}
),
pipeDerivation.unlift(barPipe, in.bar, pipeDerivation.updateContext(ctx, Path.root.field("bar"))),
{ (left, right) =>
left.setBar(right)
left
}
)
}
- Inherited from:
- PlatformProductCaseGeneration
True iff A
is defined as case class
, is NOT abstract and has a public constructor
True iff A
is defined as case class
, is NOT abstract and has a public constructor
- Inherited from:
- PlatformProductCaseGeneration
True iff A
is defined as case object
, and is public
True iff A
is defined as case object
, and is public
- Inherited from:
- PlatformProductCaseGeneration
True iff A
has a (public) default constructor and at least one (public) method starting with set
True iff A
has a (public) default constructor and at least one (public) method starting with set
- Inherited from:
- PlatformProductCaseGeneration
Check is A <:< B
in a platform-independent code
Check is A <:< B
in a platform-independent code
- Inherited from:
- PlatformGenerators
Whether Out
type could be constructed as "product case"
Whether Out
type could be constructed as "product case"
- Inherited from:
- ProductCaseGeneration
Whether both In
and Out
are ADTs/Java Enums
Whether both In
and Out
are ADTs/Java Enums
- Inherited from:
- SumCaseGeneration
Should generate code pipeDerivation.lift { (in, ctx) => ... }
Should generate code pipeDerivation.lift { (in, ctx) => ... }
- Inherited from:
- PlatformGenerators
Should generate code pipeDerivation.mergeResults(ctx, ra, rb, (a, b) => ...)
Should generate code pipeDerivation.mergeResults(ctx, ra, rb, (a, b) => ...)
- Inherited from:
- PlatformGenerators
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`
- Inherited from:
- PlatformDefinitions
Allows displaying the generated code in platform-independent way
Allows displaying the generated code in platform-independent way
- Inherited from:
- PlatformDefinitions
Should generate code pipeDerivation.pureResult(a)
Should generate code pipeDerivation.pureResult(a)
- Inherited from:
- PlatformGenerators
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.
- Inherited from:
- PlatformDefinitions
Reads configs if passed, or fallback to defaults (empty Settings
) otherwise
Reads configs if passed, or fallback to defaults (empty Settings
) otherwise
- Inherited from:
- Definitions
Should use platform-specific way of reporting information from macro on INFO level
Should use platform-specific way of reporting information from macro on INFO level
- Inherited from:
- PlatformGenerators
Should use platform-specific way of reporting errors from macro
Should use platform-specific way of reporting errors from macro
- Inherited from:
- PlatformGenerators
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
- Inherited from:
- PlatformDefinitions
Allows summoning the type class in platform-independent way
Allows summoning the type class in platform-independent way
- Inherited from:
- PlatformDefinitions
Summons Type independently of the platform
Summons Type independently of the platform
- Inherited from:
- Definitions
Should generate code pipeDerivation.unlift(pipe)(in, ctx)
Should generate code pipeDerivation.unlift(pipe)(in, ctx)
- Inherited from:
- PlatformGenerators
Concrete 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
Inherited fields
Takes Settings
and passes them to generators, the first which decides it's their case, attempt generation
Takes Settings
and passes them to generators, the first which decides it's their case, attempt generation
- Inherited from:
- Generators