diff options
Diffstat (limited to 'Main.hs')
-rw-r--r-- | Main.hs | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -1,3 +1,4 @@ +{-# LANGUAGE LambdaCase #-} module Main where import Control.Monad (forM_, when) @@ -35,8 +36,9 @@ compatibleTargets pd plan = parseCabalPlan' :: FoundCabalSpec -> IO CabalPlan parseCabalPlan' foundSpec = parseCabalPlan (foundcsRootDir foundSpec </> "dist-newstyle/cache/plan.json") - >>= maybe (die "Cabal plan.json not found; make sure to run 'cabal build' beforehand") - return + >>= \case NotFound -> die "Cabal plan.json not found; make sure to run 'cabal build' beforehand" + ParseError e -> die ("Error when parsing Cabal plan.json: " ++ e) + Parsed plan -> return plan readCachedTargets :: (AnyTarget -> Bool) -> IO (FilePath, [AnyTarget], [(String, [AnyTarget])]) readCachedTargets predicate = do |