An infix version of
setVar, meant to evoke parallels to
.~ from lens.
With normal values, you can set something in a value with a lens:
x & myLens .~ y
would "set" a part of
x :: b, specified by
myLens ::
Lens' a b, to a new value
y :: a.
xVar & myLens .~~ yVar
would "set" a part of
xVar :: BVar s b (a
BVar
holding a
b), specified by
myLens :: Lens' a
b, to a new value given by
yVar :: BVar s a. The
result is a new (updated) value of type
BVar s b.
This is the main way to set values inside
BVars of container
types.
Note that this does not incurr the performance overhead issues of
viewVar and
^^., and is fairly cheap.