Vitalii Honta — Cakeless — better reader monad for deeply-nested cakes

Unlike classic Reader, CakeT allows to accumulate dependencies in `flatMap` monad.
flatMap takes CakeT with different dependency type.
flatMap resulting type is `Union` type of both `self.Dependency` and `that.Dependency`

Dependencies are picked up by special macro on the type level.
By default they are represented as `shapeless.HList`.
User is allowed to transform the dependency using (into other type by hands or directly into `case class` using `shapeless.Generic`)

User can chose specific constructor by its sequence number providing literal integer.
Depending on constructor number appropriate dependency type will be picked up.

Also cakeless provides lifecycle management (preStart, postStart, etc.),
safe resource allocation and release (using cats.effect.Bracket).

 

Добавить комментарий

Ваш e-mail не будет опубликован. Обязательные поля помечены *