typelevel-toolkit

A toolkit of great libraries to start building Typelevel apps on JVM, Node.js, and Native!

Our very own flavour of the Scala Toolkit.

Overview

Typelevel toolkit is a meta library that currently includes these libraries:

and it's published for Scala 2.12, 2.13 and 3.2.2.

To use it with Scala CLI use this directive:

//> using toolkit typelevel:default

Albeit being created to be used with Scala CLI, typelevel-toolkit can be imported into your build.sbt using:

libraryDependencies ++= Seq(
  "org.typelevel" %% "toolkit" % "0.1.25",
  "org.typelevel" %% "toolkit-test" % "0.1.25" % Test
)

// use %%% for Scala.js and Scala Native
libraryDependencies ++= Seq(
  "org.typelevel" %%% "toolkit" % "0.1.25",
  "org.typelevel" %%% "toolkit-test" % "0.1.25" % Test
)

Quick Start

Getting started with the toolkit is as simple as running a single command:

scala-cli --power new typelevel/toolkit.g8

Example

//> using toolkit typelevel:default

import cats.effect.*

object Hello extends IOApp.Simple:
  def run = IO.println("Hello toolkit!")
//> using toolkit typelevel:default

import cats.effect._

object Hello extends IOApp.Simple {
  def run = IO.println("Hello toolkit!")
}

Scala Native usage

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.

//> using toolkit typelevel:default
//> using platform native
//> using nativeVersion 0.4.15

import cats.effect.*

object Hello extends IOApp.Simple:
  def run = IO.println("Hello toolkit!")
//> using toolkit typelevel:default
//> 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.