summaryrefslogtreecommitdiffstats
path: root/tv/5pkgs/haskell/xmonad-tv/src/Helpers/Path.hs
blob: 1029d60bec98912a34b3142f6512df8bca8c39c7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
module Helpers.Path where

import qualified Data.List
import qualified System.Directory
import qualified System.IO.Unsafe


findExecutable :: String -> FilePath
findExecutable =
    System.IO.Unsafe.unsafePerformIO . find
  where
    find name =
        maybe failure id <$> System.Directory.findExecutable name
      where
        failure = error (Data.List.intercalate " " [name, "not found"])