diff --git a/lenses.hs b/lenses.hs index 6194cb4..d6c4ce2 100644 --- a/lenses.hs +++ b/lenses.hs @@ -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