From 4f50db840967c2409c9bf96c2d6525f99e39cdca Mon Sep 17 00:00:00 2001 From: Julien Dessaux Date: Mon, 8 Aug 2011 13:03:31 +0200 Subject: Fixed bad comments and some cosmetics --- Hsbot/Utils.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Hsbot/Utils.hs') diff --git a/Hsbot/Utils.hs b/Hsbot/Utils.hs index 912e746..2a8f58c 100644 --- a/Hsbot/Utils.hs +++ b/Hsbot/Utils.hs @@ -35,15 +35,15 @@ setGlobalQuitMVar status = do liftIO $ putMVar quitMv status -- Access rights -hasAccess :: Maybe IRC.Prefix -> AccessRight -> Env IO (Bool) +hasAccess :: Maybe IRC.Prefix -> AccessRight -> Env IO Bool hasAccess Nothing _ = return False hasAccess (Just mask) right = do botMVar <- asks envBotState - liftIO (readMVar botMVar) >>= evalStateT (gets botAccess >>= return . or . map accessMatch) + liftIO (readMVar botMVar) >>= evalStateT (fmap (any accessMatch) (gets botAccess)) where accessMatch :: AccessList -> Bool accessMatch (AccessList amask arights) - | mask == amask = or [L.elem Admin arights, L.elem right arights] + | mask == amask = or [Admin `L.elem` arights, right `L.elem` arights] | otherwise = False -- Helpers -- cgit v1.2.3