From 84a8e42ac055a93e456857c3cde4a1f79dd11be1 Mon Sep 17 00:00:00 2001 From: Adam Vogt Date: Sun, 29 Nov 2009 03:26:50 +0000 Subject: [PATCH] Use lookup instead of find in A.PerWorkspaceKeys --- XMonad/Actions/PerWorkspaceKeys.hs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/XMonad/Actions/PerWorkspaceKeys.hs b/XMonad/Actions/PerWorkspaceKeys.hs index dcf1a9b4..20705e1c 100644 --- a/XMonad/Actions/PerWorkspaceKeys.hs +++ b/XMonad/Actions/PerWorkspaceKeys.hs @@ -21,7 +21,6 @@ module XMonad.Actions.PerWorkspaceKeys ( import XMonad import XMonad.StackSet as S -import Data.List (find) -- $usage -- @@ -42,9 +41,9 @@ chooseAction f = withWindowSet (f . S.currentTag) -- If it isn't listed, then run default action (marked with empty string, \"\"), or do nothing if default isn't supplied. bindOn :: [(String, X())] -> X() bindOn bindings = chooseAction chooser where - chooser ws = case find ((ws==).fst) bindings of - Just (_, action) -> action - Nothing -> case find ((""==).fst) bindings of - Just (_, action) -> action + chooser ws = case lookup ws bindings of + Just action -> action + Nothing -> case lookup "" bindings of + Just action -> action Nothing -> return ()