From 76cb9b9877c6367bd92e2fba12b15f7133172bd1 Mon Sep 17 00:00:00 2001 From: tailor Date: Sat, 4 Aug 2007 06:47:19 +0000 Subject: [PATCH] [gitconv @ MPD.add_: refactor] --- MPD.hs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/MPD.hs b/MPD.hs index 0362d4d..0fcfd19 100644 --- a/MPD.hs +++ b/MPD.hs @@ -299,11 +299,9 @@ add_ :: Connection -> Maybe String -- ^ Optionally specify a playlist to operate on -> String -> IO () -add_ conn plname x = getResponse_ conn cmd - where cmd = maybe ("add " ++ path) - (\pl -> "playlistadd " ++ show pl ++ " " ++ path) - plname - path = show x +add_ conn Nothing = getResponse_ conn . ("add " ++) . show +add_ conn (Just plname) = getResponse_ conn . + (("playlistadd " ++ show plname ++ " ") ++) . show -- | Clear a playlist. Clears current playlist if no playlist is specified. -- If the specified playlist does not exist, it will be created. -- 2.11.4.GIT