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 <rahm@google.com>2022-04-22 18:03:27 -0600
commit32a394483e5d8f571b27a70f9a7156cae1ed6180 (patch)
treef2fab1c1edeb5d7de92e7de1ab5f5b85b91fe057 /src/Rahm/Desktop/Keys
parent7dfbd2e4bc893f7527f9cc4ebf9c474ddfb0dc65 (diff)
downloadrde-32a394483e5d8f571b27a70f9a7156cae1ed6180.tar.gz
rde-32a394483e5d8f571b27a70f9a7156cae1ed6180.tar.bz2
rde-32a394483e5d8f571b27a70f9a7156cae1ed6180.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])))