cquiroz on master
Update sbt-scalafmt to 2.4.5 Merge pull request #1236 from s… (compare)
xuwei-k on master
Update index.js (#1234) * Upda… (compare)
cquiroz on master
Update scalafmt-core to 3.2.1 Merge pull request #1235 from s… (compare)
GenLens[MyType](_.abc.def)to build a lens for later usage, which works very very nice (Monocle 2.1.0 Scala 2.13).
composeLenswith a lens and "identity lenses" I would expect no effect on the result after executing the "lens chain".
GenLens[MyType](identity)does not compile,
GenLens[MyType](x=>x)does not compile too.
Upgrading to 3.0.0 and trying to switch to
andThen but it’s causing ambiguous overloaded method in a lot of places.
val x: Optional[State,Option[EiaChannelNumber]] = Lenses.muxEiaChannel(idx) val y: Optional[State,EiaChannelNumber] = x.andThen(some) // Overloaded method andThen // Lenses.muxEiaChannel(idx).andThen(some)
It works if I explicitly type the intermediate variables but it does not like to be chained. Any tips?
indexworks as expected
Ok, in a source file that just imports from the monocle namespace, I have:
val projectListLens = Iso.id[List[Project]].asLens def indexedProjectLens(projectId: Int) = projectListLens.index(projectId)
and all seems good. Then, in a separate source file that imports from monocle as well as from cats, I have:
val projectLens = indexedProjectLens(projectId) // this is ok val plens = projectListLens.index(projectId) // this is not ok
with a type mismatch on
projectId: found projectId.type (underlying type Int), expected cats.Representable.Aux[monocle.PLens[...]]
How do I make the latter (
val plens = ...) work when cats names are imported?
I think all I need is a way to be able to pick leaves of a
type Tree[+A] = Free[Map[String,_], A]
by the path to it's leaves... (need to think if that is the right datastructure first)