summaryrefslogtreecommitdiff
path: root/Main.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Main.hs')
-rw-r--r--Main.hs6
1 files changed, 4 insertions, 2 deletions
diff --git a/Main.hs b/Main.hs
index 5cbf592..c1f5f9b 100644
--- a/Main.hs
+++ b/Main.hs
@@ -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