Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mateuszkubuszok/explain-given
Preview how your implicits/givens got resolved on Scala 3
https://github.com/mateuszkubuszok/explain-given
debugging given implicit scala scala-3
Last synced: 15 days ago
JSON representation
Preview how your implicits/givens got resolved on Scala 3
- Host: GitHub
- URL: https://github.com/mateuszkubuszok/explain-given
- Owner: MateuszKubuszok
- License: apache-2.0
- Created: 2024-08-27T12:01:45.000Z (2 months ago)
- Default Branch: master
- Last Pushed: 2024-08-27T12:58:04.000Z (2 months ago)
- Last Synced: 2024-10-14T19:42:36.494Z (24 days ago)
- Topics: debugging, given, implicit, scala, scala-3
- Language: Scala
- Homepage:
- Size: 1.95 MB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Explain given
Prints the `given` that was resolved in a method which expects `using`.
```scala
//> using scala 3.3.3
//> using dep com.kubuszok::explain-given:0.1.0
//> using dep io.circe::circe-generic::0.14.9case class Foo(a: Int, b: String)
case class Bar(list: List[Foo])import com.kubuszok.explain_given.ExplainGiven
import io.circe.*, io.circe.generic.auto.*, io.circe.syntax.*// both compile time hint as well as runtime println
Bar(List(Foo(10, "test"))).asJson(ExplainGiven.apply)
// compile time hint only
Bar(List(Foo(10, "test"))).asJson(ExplainGiven.withHint)
// println only (runtime)
Bar(List(Foo(10, "test"))).asJson(ExplainGiven.withPrintln)
```![screenshot](/screenshot.png)