findAll :: IO [FilePath]
findAll = map snd `fmap` runFinds
    [ path "/Library/Frameworks/GHC.framework"                          >>> exists
    , path "/Library/Frameworks/HaskellPlatform.framework"              >>> exists
    , path "/Library/Haskell"                                           >>> exists
    , path "/Users" >>> star >>> path ".cabal" >>> matches (excludePrefix "config")
    , path "/Users" >>> star >>> path ".ghc"   >>> matches (excludePrefix "ghci")
    , path "/Users" >>> star >>> path "Library/Haskell"                 >>> exists
    , path "/usr/local/lib" >>> matches ghcName
    , path "/usr/local/lib" >>> matches (not . ghcName) >>> matches ghcName
    ]
  where
    excludePrefix :: String -> FilePath -> Bool
    excludePrefix p fp = not $ p `isPrefixOf` fp

-- | Find symlinks on the PATH that point into directories that are going to be
-- removed.
findAll :: IO [FilePath]
findAll = map snd `fmap` runFinds
    [ path "/Library/Frameworks/GHC.framework"                          >>> exists
    , path "/Library/Frameworks/HaskellPlatform.framework"              >>> exists
    , path "/Library/Haskell"                                           >>> exists
    , path "/Users" >>> star >>> path ".cabal" >>> matches (excludePrefix "config")
    , path "/Users" >>> star >>> path ".ghc"   >>> matches (excludePrefix "ghci")
    , path "/Users" >>> star >>> path "Library/Haskell"                 >>> exists
    , path "/usr/local/lib" >>> matches ghcName
    , path "/usr/local/lib" >>> matches (not . ghcName) >>> matches ghcName
    ]
  where
    excludePrefix :: String -> FilePath -> Bool
    excludePrefix p fp = not $ p `isPrefixOf` fp

-- | Find symlinks on the PATH that point into directories that are going to be
-- removed.
findAll = map snd `fmap` runFinds
    [ path "/Library/Frameworks/GHC.framework"                          >>> exists
    , path "/Library/Frameworks/HaskellPlatform.framework"              >>> exists
    , path "/Library/Haskell"                                           >>> exists
    , path "/Users" >>> star >>> path ".cabal" >>> matches (excludePrefix "config")
    , path "/Users" >>> star >>> path ".ghc"   >>> matches (excludePrefix "ghci")
    , path "/Users" >>> star >>> path "Library/Haskell"                 >>> exists
    , path "/usr/local/lib" >>> matches ghcName
    , path "/usr/local/lib" >>> matches (not . ghcName) >>> matches ghcName
    ]
  where
    excludePrefix :: String -> FilePath -> Bool
    excludePrefix p fp = not $ p `isPrefixOf` fp

-- | Find symlinks on the PATH that point into directories that are going to be
-- removed.