Closed skysantalucial closed 4 years ago
@skysantalucial the current behavior is correct according to the Optional
laws
@gcanti Ok, so it's just a matter of updating the examples
In this case how can i go from this { name: 'Laura', surname: none }
to this { name: 'Laura', surname: Some("Santalucia") }
using an Optional
? Is it possibile?
Ok, so it's just a matter of updating the examples
Yup, thanks for pointing out.
using an Optional? Is it possibile?
No it isn't, you need a Lens
const surname = Lens.fromProp<Person>()('surname')
const p: Person = { name: 'Giulio', surname: none }
console.log(surname.set(some('Canti'))(p)) // => { name: 'Giulio', surname: Some("Canti") }
understood π thanks for the help
π Bug report
Hello! I stumbled on a problem while experimenting with the examples. Seems like setting a new value to a Prism is no more possible
Current Behavior
Expected behavior
Your environment
According to my tests this behavior appeared from version 2.0.1