这里有一个非常简单的问题。在观看了一个优秀的透镜介绍视频之后:
http://www.youtube.com/watch?v=efv0SQNde5Q
我想尝试一下讲座中涉及的一个简单示例:
import scalaz.Lens._
fst.andThen(snd).set(((1,2),3),9)
接着出现了这个错误
error: type mismatch;
found : scalaz.Lens[(Nothing, Nothing),Nothing]
required: scalaz.Lens[(Nothing, Nothing),C]
Note: Nothing <: C, but class Lens is invariant in type B.
You may wish to define B as +B instead. (SLS 4.5)
fst.andThen(snd).set(((1,2),3))
^
任何想法可以让这个工作吗?