From c75c5f8254181242a96f3f6652a53cc70f40b13e Mon Sep 17 00:00:00 2001 From: Josh Rahm Date: Mon, 28 Mar 2022 23:27:45 -0600 Subject: Fix things that Hlint is complaining about. --- src/Internal/Lib.hs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/Internal/Lib.hs') diff --git a/src/Internal/Lib.hs b/src/Internal/Lib.hs index 3beb640..d8784ea 100644 --- a/src/Internal/Lib.hs +++ b/src/Internal/Lib.hs @@ -47,7 +47,7 @@ data WorkspaceState = Current | Hidden | Visible getPopulatedWorkspaces :: (Ord i) => S.StackSet i l a sid sd -> [(WorkspaceState, S.Workspace i l a)] getPopulatedWorkspaces (S.StackSet (S.Screen cur _ _) vis hi _) = - sortBy (comparing (tag . snd)) $ + sortOn (tag . snd) $ mapMaybe (\w@(S.Workspace _ _ s) -> fmap (const (Hidden, w)) s) hi ++ map (\(S.Screen w _ _) -> (Visible, w)) vis ++ [(Current, cur)] @@ -93,10 +93,10 @@ swapWorkspace toWorkspaceName = do windows $ \ss -> do let fromWorkspace = tag $ workspace $ current ss toWorkspace = [toWorkspaceName] in - (StackSet (swapSc fromWorkspace toWorkspace $ current ss) + StackSet (swapSc fromWorkspace toWorkspace $ current ss) (map (swapSc fromWorkspace toWorkspace) $ visible ss) (map (swapWs fromWorkspace toWorkspace) $ hidden ss) - (floating ss)) + (floating ss) where swapSc fromWorkspace toWorkspace (Screen ws a b) = Screen (swapWs fromWorkspace toWorkspace ws) a b @@ -125,7 +125,7 @@ getString = runQuery $ do relativeWorkspaceShift :: Selector -> X () relativeWorkspaceShift (Selector selector) = do windows $ \ss -> - let tags = sort $ (tag . snd <$> filter (\x -> fst x /= Visible ) (getPopulatedWorkspaces ss)) + let tags = sort (tag . snd <$> filter (\x -> fst x /= Visible ) (getPopulatedWorkspaces ss)) from = tag $ workspace $ current ss to = selector from tags in greedyView to ss @@ -144,7 +144,7 @@ prev = Selector $ \a l -> withScreen :: (WorkspaceId -> WindowSet -> WindowSet) -> Int -> X () withScreen fn n = do windows $ \windowSet -> - case (getHorizontallyOrderedScreens windowSet !! n) of + case getHorizontallyOrderedScreens windowSet !! n of Nothing -> windowSet Just screen -> fn (tag $ workspace screen) windowSet -- cgit