A version of the API that is specialised to Id.
The functions in this API perform their operations immediately
on the current thread and thus do not wrap their results in any effect monad.
Implementation note: I really didn't want to have this separate copy of the API,
but I couldn't get type inference to understand that Id[A] == A.
e.g. the following doesn't compile:
implicit val cache: LovelyCache[String] = ???
import scalacache.modes.sync._
val x: Option[String] = scalacache.get("hello")
[error] ... polymorphic expression cannot be instantiated to expected type;
[error] found : [F[_], V]F[Option[V]]
[error] required: Option[String]
If anyone can find a workaround to make this compile, I will be much obliged.
A version of the API that is specialised to Id. The functions in this API perform their operations immediately on the current thread and thus do not wrap their results in any effect monad.
Implementation note: I really didn't want to have this separate copy of the API, but I couldn't get type inference to understand that Id[A] == A. e.g. the following doesn't compile:
implicit val cache: LovelyCache[String] = ??? import scalacache.modes.sync._ val x: Option[String] = scalacache.get("hello")
[error] ... polymorphic expression cannot be instantiated to expected type; [error] found : [F[_], V]F[Option[V]] [error] required: Option[String]
If anyone can find a workaround to make this compile, I will be much obliged.