All Downloads are FREE. Search and download functionalities are using the official Maven repository.

papiers.core.Collection.scala Maven / Gradle / Ivy

There is a newer version: 0.2.0
Show newest version
package papiers.core

import cats.implicits._
import cats.effect._

import MonadApp._

case class Collection(id: Int, name: String)

object Collection:
  def fromJsonList(json: String): Either[AppError, List[Collection]] =
    import io.circe._, io.circe.generic.auto._, io.circe.parser._, io.circe.syntax._

    decode[List[Collection]](json) match
      case Left(e) => Left(JsonDecodeError(e.toString))
      case Right(x) => Right(x)




© 2015 - 2025 Weber Informatics LLC | Privacy Policy