I can modify Map using focus and index just fine. Is there a similar functionality in Monocle to update a sequence at given index? The error is Cou ...
I can modify Map using focus and index just fine. Is there a similar functionality in Monocle to update a sequence at given index? The error is Cou ...
I have a list (let's call it L1) of tuples, in this tuple _1 is some class with data and _2 is a list (let's call it L2) of some other classes with ot ...
(Edit I'm using monocle-ts, but if it's not possible with monocle-ts (since the author even says it's just a partial port of the original Monocle for ...
I am trying to create a Monocle lens with nested case classes and sequences. Compilation fails on the last line. I am using Monocle 1.5.0-cats. PS ...
Many types of optics have a van Laarhoven representation. For example, a Lens of type Lens s t a b can be represented as: Similarly a Traversal, ...
The university example explains how to add and delete items of a map: This does not work with Lists, though: Adding does nothing, deleting throw ...
I've seen the official example of updating a Map but I'm having trouble with the syntax. I want to update a key "app" in the labels Map. But I can' ...
Monocle is a great library (and not the only one) which implements lenses pattern, which is great if we have to change one field in huge nested object ...
Using Monocle I can define a Lens to read a case class member without issue, This can used to compare the value of md5 between two objects and fail ...
I have a structure of nested case classes that I create with default values: I would like to create the whole thing with default values and then mo ...
I was reading about Diode, and it made me think about lenses in Monocle / Scalaz: If I (conditionally) modify deeply some part of a deeply nested dat ...
I am trying to solve the following Scala compiler error below. In (pseudo)-Haskell (without sub-typing) this would be something like : Currently ...
I've refactored my code for day 12 of advent of code by using monocle, a lens library in scala. Is it possible to improve this code : And here is ...
I'm giving a try to monocle for the first time. Here is the case class : And the current modification, using standard scala, that I would like to ...
I'm trying to figure out how to use applyOptional. I've got this: But the compiler tells me "Cannot resolve symbol applyOptional." I imported Apply ...
Given the following code: how can i "filter" out certain Persons from the selection, NOT by index but by a specific property of Person, like: I ...
I wanted to try lenses and the Monocle library seemed (from my noobish perspective) good with all those fancy boilerplate-less @Lenses. Unfortunately ...
Let's say I have a pair of conversion functions I could represent these fairly easily using Optics. stringIntPrism :: Prism String Int However i ...
Given the JsonExample in the monocle project, I would like to create a lens where a set call will either replace a value in a key/value pair, or creat ...
Is there some function with signature like With semantics run modification of chosen part and get result One implementation could be but if th ...