September 2018
Intermediate to advanced
398 pages
9h 43m
English
Suppose that you are building a program to manage a shop's inventory. The following is a simplified API to manage the items:
import cats.{Id, Monad}import cats.implicits._case class Item(id: Int, label: String, price: Double, category: String)trait ItemApi[F[_]] { def findAllItems: F[Vector[Item]] def saveItem(item: Item): F[Unit]}
The API is parametrized with an F context. This allows you to have different implementations of your API, as follows:
Read now
Unlock full access