clarify the & operator

This commit is contained in:
千住柱間 2025-01-28 04:59:54 +00:00
commit 9dcba8408a

View file

@ -1,4 +1,3 @@
{-
here i show how to use lenses to handle states (didnt found any example on states in internet)
@ -62,6 +61,10 @@ main = do
stateRef <- newIORef initialState
-- Corrected lens chain with &
{-
& is just backwards function application;
x f , in which f will be applied to the value x
-}
modifyIORef' stateRef $ \s ->
s & ui . keyBindings . at "Ctrl+X" .~ Just "cut"
& user . prefs . darkMode .~ True