You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
modify for Optional will modify only existent field so if we compose Optionalwith anything else, it becomes update only, it could not insert
while for PPrism we could use another definition like
defset(d: D):S=>T=
self.set(other.reverseGet(d))
which able to insert new value even if original object has nothing here yet
So can we have specialized compose for Iso and Prism ?
The text was updated successfully, but these errors were encountered:
Odomontois
changed the title
Composed Optional stops from inserting value
Composing Optional with Iso and Prism prevents inserting value
Nov 26, 2015
Odomontois
changed the title
Composing Optional with Iso and Prism prevents inserting value
Composing Optional with Iso and Prism prevents inserting value
Nov 26, 2015
Now we can see why we cannot insert or delete via index, we only have a function V => V. In order to insert or delete we need a function Option[V] => Option[V]
Some person here asks for help
If I'm not misundersanding
index
should work asupsert
already and does not work because of composition.Composing
Optional
regarding that with anything fromIso
and up toOptional
is happening likesetting new value in this composition is like
modify
forOptional
will modify only existent field so if we composeOptional
with anything else, it becomesupdate
only, it could notinsert
while for
PPrism
we could use another definition likewhich able to insert new value even if original object has nothing here yet
So can we have specialized compose for
Iso
andPrism
?The text was updated successfully, but these errors were encountered: