diff --git a/docs/index.md b/docs/index.md index 0c2a750..fb5cae9 100644 --- a/docs/index.md +++ b/docs/index.md @@ -69,9 +69,39 @@ object Hello extends IOApp.Simple { ``` @:@ -### Native Image +### Scala Native usage -When building GraalVM Native Image the --no-fallback option is required, otherwise native-image will try searching +Since the native flavour of most of the **Typelevel libraries** is, at the moment, built against Scala Native 0.4.15, when using [Scala CLI] you have to declare the Scala native's version, i.e. + +@:select(scala-version) +@:choice(scala-3) +```scala mdoc:reset:silent +//> using toolkit typelevel:latest +//> using platform native +//> using nativeVersion 0.4.15 + +import cats.effect.* + +object Hello extends IOApp.Simple: + def run = IO.println("Hello toolkit!") +``` +@:choice(scala-2) +```scala mdoc:reset:silent +//> using toolkit typelevel:latest +//> using platform native +//> using nativeVersion 0.4.15 + +import cats.effect._ + +object Hello extends IOApp.Simple { + def run = IO.println("Hello toolkit!") +} +``` +@:@ + +## Native Image + +When building GraalVM Native Image the `--no-fallback` option is required, otherwise native-image will try searching a static reflection configuration for [this Enumeration method]. Thus using this flag is safe only if you're not using Enumerations in your codebase, see [this comment] for more info.