这里真的很简单的问题。看着一个很好的介绍镜头后:斯卡拉斯镜头组成
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))
^
关于如何使这项工作的任何想法?
非常感谢。我自从偶然发现这篇文章,这也有助于理解scala的局限性: http://pchiusano.blogspot.com/2011/05/making-most-of-scalas-extremely-limited.html – billymillions 2012-08-03 17:55:38