--------------------------------------------------------------------------------
-- The Cabal library likes to really keep changing things...

cabalFileComponents :: IO [String]
cabalFileComponents = do
  dir   <- getCurrentDirectory
  cntns <- map (dir </>) <$> listDirectory dir
  files <- filterM doesFileExist cntns
  let cabalFiles = filter isCabalFile files
  case cabalFiles of
    []    -> return []
    (c:_) -> getComponents <$> parseCabalFile c
cabalFileComponents :: IO [String]
cabalFileComponents = do
  dir   <- getCurrentDirectory
  cntns <- map (dir </>) <$> listDirectory dir
  files <- filterM doesFileExist cntns
  let cabalFiles = filter isCabalFile files
  case cabalFiles of
    []    -> return []
    (c:_) -> getComponents <$> parseCabalFile c
cabalFileComponents = do
  dir   <- getCurrentDirectory
  cntns <- map (dir </>) <$> listDirectory dir
  files <- filterM doesFileExist cntns
  let cabalFiles = filter isCabalFile files
  case cabalFiles of
    []    -> return []
    (c:_) -> getComponents <$> parseCabalFile c