aboutsummaryrefslogtreecommitdiff
path: root/src/Rahm/Desktop/Keys
diff options
context:
space:
mode:
authorJosh Rahm <rahm@google.com>2022-04-22 18:03:27 -0600
committerJosh Rahm <joshuarahm@gmail.com>2022-10-09 12:19:46 -0600
commit92deb70d1268317e3b80c8c28e0358f0c9064f3e (patch)
treef2fab1c1edeb5d7de92e7de1ab5f5b85b91fe057 /src/Rahm/Desktop/Keys
parentbba296cf93d9e5284dd3dc397a3f73114e25c03f (diff)
downloadrde-92deb70d1268317e3b80c8c28e0358f0c9064f3e.tar.gz
rde-92deb70d1268317e3b80c8c28e0358f0c9064f3e.tar.bz2
rde-92deb70d1268317e3b80c8c28e0358f0c9064f3e.zip
Run hlint
Diffstat (limited to 'src/Rahm/Desktop/Keys')
-rw-r--r--src/Rahm/Desktop/Keys/Dsl.hs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/Rahm/Desktop/Keys/Dsl.hs b/src/Rahm/Desktop/Keys/Dsl.hs
index 2c596fc..55912f8 100644
--- a/src/Rahm/Desktop/Keys/Dsl.hs
+++ b/src/Rahm/Desktop/Keys/Dsl.hs
@@ -455,7 +455,7 @@ documentation = execWriter . document' ""
where
document' pref keybindings =
forM_ (sortOn (map (\(a, b) -> (b, a)) . snd . snd) $ Map.toList (keyBindingsToList keybindings)) $ \(doc, (thing, keys)) -> do
- when ((not $ null doc) || hasSubmap thing) $
+ when (not (null doc) || hasSubmap thing) $
tell $ printf "%s%s: %s\n" pref (intercalate " or " $ map prettyShow keys) doc
case thing of
Action _ -> return ()
@@ -467,7 +467,7 @@ documentation = execWriter . document' ""
keyBindingsToList :: KeyBindings -> Map String (KeyBinding, [(KeyMask, KeySym)])
keyBindingsToList b =
- fmap (\list -> ((\(_, Documented _ t) -> t) (head list), map fst list)) $
+ (\list -> ((\(_, Documented _ t) -> t) (head list), map fst list)) <$>
group (\(_, Documented doc _) -> doc) (sortOn (snd . fst) $ Map.toList b)
prettyShow :: (KeyMask, KeySym) -> String
@@ -490,7 +490,7 @@ documentation = execWriter . document' ""
concatMap ((++"-") . snd) $ filter ((/=0) . (.&.mask) . fst) masks
- group :: (Ord b) => (a -> b) -> [a] -> (Map b [a])
+ group :: (Ord b) => (a -> b) -> [a] -> Map b [a]
group fn = Map.fromListWith (++) . map (first fn . (\a -> (a, [a])))