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

io.chrisdavenport.mules.noop.NoOpCache.scala Maven / Gradle / Ivy

There is a newer version: 0.7.0
Show newest version
package io.chrisdavenport.mules.noop

import io.chrisdavenport.mules.Cache
import cats.Applicative

private class NoOpCache[F[_], K, V](implicit F: Applicative[F]) extends Cache[F, K, V]{
  val noneF : F[Option[V]] = F.pure(None)
  // Members declared in io.chrisdavenport.mules.Delete
  def delete(k: K): F[Unit] = F.unit
  
  // Members declared in io.chrisdavenport.mules.Insert
  def insert(k: K, v: V): F[Unit] = F.unit
  
  // Members declared in io.chrisdavenport.mules.Lookup
  def lookup(k: K): F[Option[V]] = noneF
}

object NoOpCache {
  def impl[F[_]: Applicative, K, V] : Cache[F, K, V] = new NoOpCache[F, K, V]
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy