avoid needing PartialPrelude
authorJoey Hess <joeyh@joeyh.name>
Thu, 22 Sep 2016 15:29:53 +0000 (11:29 -0400)
committerJoey Hess <joeyh@joeyh.name>
Thu, 22 Sep 2016 15:29:53 +0000 (11:29 -0400)
Utility/FreeDesktop.hs

index 67f6219bd11939220e5468133cad5adf68c4e5a0..9863198dbe5fdd1041e909bc367b0390fa45bf85 100644 (file)
@@ -31,7 +31,6 @@ module Utility.FreeDesktop (
 import Utility.Exception
 import Utility.UserInfo
 import Utility.Process
-import Utility.PartialPrelude
 import Utility.Directory
 
 import System.Environment
@@ -135,7 +134,9 @@ userConfigDir = xdgEnvHome "CONFIG_HOME" ".config"
 userDesktopDir :: IO FilePath
 userDesktopDir = maybe fallback return =<< (parse <$> xdg_user_dir)
   where
-       parse = maybe Nothing (headMaybe . lines)
+       parse s = case lines <$> s of
+               Just (l:_) -> Just l
+               _ -> Nothing
        xdg_user_dir = catchMaybeIO $ readProcess "xdg-user-dir" ["DESKTOP"]
        fallback = xdgEnvHome "DESKTOP_DIR" "Desktop"