mirror of
https://github.com/jtdaugherty/brick.git
synced 2025-01-07 14:36:59 +03:00
Rename with to withLens
This commit is contained in:
parent
9ef4fa3a95
commit
d17754b35f
@ -45,11 +45,11 @@ drawUI st = [a]
|
||||
vCenter $
|
||||
(hCenter $ borderWithLabel bs bsName $
|
||||
(hLimit 25 (
|
||||
(vLimit 1 $ useAttr (cyan `on` blue) $ with stEditor drawEditor)
|
||||
(vLimit 1 $ useAttr (cyan `on` blue) $ withLens stEditor drawEditor)
|
||||
<<=
|
||||
hBorder bs
|
||||
=>>
|
||||
(vLimit 10 $ with stList drawList)
|
||||
(vLimit 10 $ withLens stList drawList)
|
||||
)))
|
||||
<<=
|
||||
(vLimit 1 $ vPad ' ')
|
||||
|
@ -24,7 +24,7 @@ module Brick.Prim
|
||||
, saveSize
|
||||
, hRelease
|
||||
, vRelease
|
||||
, with
|
||||
, withLens
|
||||
, readState
|
||||
, apply
|
||||
)
|
||||
|
@ -31,7 +31,7 @@ module Brick.Prim.Internal
|
||||
, saveSize
|
||||
, hRelease
|
||||
, vRelease
|
||||
, with
|
||||
, withLens
|
||||
, readState
|
||||
, apply
|
||||
)
|
||||
@ -279,8 +279,8 @@ hRelease = withReaderT (& w .~ unrestricted) --- NB
|
||||
vRelease :: Prim a -> Prim a
|
||||
vRelease = withReaderT (& h .~ unrestricted) --- NB
|
||||
|
||||
with :: (Lens' a b) -> Prim b -> Prim a
|
||||
with target p = do
|
||||
withLens :: (Lens' a b) -> Prim b -> Prim a
|
||||
withLens target p = do
|
||||
outerState <- lift get
|
||||
let oldInnerState = outerState^.target
|
||||
c <- ask
|
||||
|
Loading…
Reference in New Issue
Block a user