-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
privatize stuff inside the internal package
- Loading branch information
Showing
32 changed files
with
93 additions
and
128 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 4 additions & 14 deletions
18
ducktapeNext/src/main/scala/io/github/arainko/ducktape/Transformer.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,22 @@ | ||
package io.github.arainko.ducktape | ||
|
||
import scala.quoted.* | ||
import io.github.arainko.ducktape.internal.Transformations | ||
import io.github.arainko.ducktape.DefinitionViaBuilder.PartiallyApplied | ||
import io.github.arainko.ducktape.internal.Transformations | ||
|
||
trait Transformer[Source, Dest] extends Transformer.Derived[Source, Dest] | ||
|
||
object Transformer { | ||
inline given derive[Source, Dest]: Transformer.Derived[Source, Dest] = new { | ||
def transform(value: Source): Dest = Transformations.between[Source, Dest](value) | ||
} | ||
} | ||
|
||
def define[Source, Dest]: DefinitionBuilder[Source, Dest] = | ||
def define[Source, Dest]: DefinitionBuilder[Source, Dest] = | ||
DefinitionBuilder[Source, Dest] | ||
|
||
def defineVia[Source]: DefinitionViaBuilder.PartiallyApplied[Source] = | ||
def defineVia[Source]: DefinitionViaBuilder.PartiallyApplied[Source] = | ||
DefinitionViaBuilder.create[Source] | ||
|
||
sealed trait Derived[Source, Dest] { | ||
def transform(value: Source): Dest | ||
} | ||
} | ||
|
||
object Test extends App { | ||
// given t: Transformer[Int, Int] = ??? | ||
|
||
internal.CodePrinter.code: | ||
summon[Transformer.Derived[Int, Int]] | ||
|
||
// Transformer.derive[Int, Int].transform(1) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
ducktapeNext/src/main/scala/io/github/arainko/ducktape/internal/Depth.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 2 additions & 3 deletions
5
ducktapeNext/src/main/scala/io/github/arainko/ducktape/internal/Logger.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.