Using io-choice.
This commit is contained in:
@@ -5,17 +5,17 @@ module CabalDev (modifyOptions) where
|
||||
options ghc-mod uses to check the source. Otherwise just pass it on.
|
||||
-}
|
||||
|
||||
import Control.Applicative ((<$>),(<|>))
|
||||
import Control.Applicative ((<$>))
|
||||
import Control.Exception (throwIO)
|
||||
import Control.Exception.IOChoice
|
||||
import Data.List (find)
|
||||
import System.Directory
|
||||
import System.FilePath (splitPath,joinPath,(</>))
|
||||
import Text.Regex.Posix ((=~))
|
||||
import Types
|
||||
import Data.Alternative.IO ()
|
||||
|
||||
modifyOptions :: Options -> IO Options
|
||||
modifyOptions opts = found <|> notFound
|
||||
modifyOptions opts = found ||> notFound
|
||||
where
|
||||
found = addPath opts <$> findCabalDev
|
||||
notFound = return opts
|
||||
|
||||
Reference in New Issue
Block a user