marcinzh / yamlike   0.2.0

MIT License GitHub

YAML-like list syntax for Scala, abusing experimental fewerBraces extension

Scala versions: 3.x 2.13

Yamlike

Two tiny DSLs providing YAML-like list syntax. Inspired by fewerBraces extension for Scala 3.

1. yamlist

Maven Central

Provides a tiny, auto-derivable typeclass for list elements. Together with fewerBraces extension, allows creating custom DSLs with YAML-like list syntax:

val data =
  foo:
    - bar
    - qux:
    	- baz

Usage in examples.

libraryDependencies += "io.github.marcinzh" %% "yamlist" % "0.2.0"

2. yamlayer

Maven Central

Augmentation of ZIO 1.x.

ZIO 2.x introduced provide macro. It works, by taking an arbitrarily ordered collection of ZLayers, and automatically building dependency graph from them.

This subproject extends ZIO 1.x with single provideLayers method. It brings in functionality similar to ZIO 2.x's provide. The main difference, is that in yamlayer the topological sorting of dependencies happens at runtime, instead of at compile time (no macros are used).

Usage:

import zio._
import yamlayer._

someZIOProgram.provideLayers(
  - layer1
  - layer2
  - layer3
)

Or with fewerBraces extension, for even more YAML-like look 😎:

someZIOProgram.provideLayers:
  - layer1
  - layer2
  - layer3

Cross compiled for Scala 2.13.x and 3.x.

libraryDependencies += "io.github.marcinzh" %% "yamlayer" % "0.2.0"