我们再示范一下cats官方文件里关于free monad例子:模拟一个KVStore的put,get,delete功能。...[A] = Free[KVStoreA,A]
2 object KVStoreA {
3 def put[T](key: String, value: T): KVStore[Unit...] =
4 Free.liftF[KVStoreA,Unit](Put[T](key,value))
5 def get[T](key: String): KVStore...[A] = Free[KVStoreA,A]
10 object KVStoreA {
11 def put[T](key: String, value: T): KVStore[Unit...] =
12 Free.liftF[KVStoreA,Unit](Put[T](key,value))
13 def get[T](key: String): KVStore