diff --git a/src/Pipeline/Crawl.hs b/src/Pipeline/Crawl.hs index 6c3eb7c..6b6cdc6 100644 --- a/src/Pipeline/Crawl.hs +++ b/src/Pipeline/Crawl.hs @@ -39,7 +39,7 @@ crawl config = depGraphs <- mapM (crawlDependency config solution) (Map.toList solution) - desc <- withExceptT BM.PackageProblem (Desc.read Path.description) + desc <- (Desc.read BM.PackageProblem Path.description) let permits = BM._permissions config @@ -70,11 +70,9 @@ crawl config = getSolution :: Bool -> BM.Task Solution.Solution getSolution autoYes = do exists <- liftIO (doesFileExist Path.solvedDependencies) - withExceptT BM.PackageProblem $ - if exists then - Solution.read Path.solvedDependencies - else - Initialize.solution autoYes + if exists + then Solution.read BM.PackageProblem Path.solvedDependencies + else withExceptT BM.PackageProblem (Initialize.solution autoYes) crawlDependency @@ -89,7 +87,7 @@ crawlDependency config solution pkg@(name,version) = in BM.phase (Pkg.toString name) $ File.readBinary cache `catchError` \_ -> do - desc <- withExceptT BM.PackageProblem (Desc.read (root Path.description)) + desc <- Desc.read BM.PackageProblem (root Path.description) packageGraph <- CrawlPackage.dfsFromExposedModules root solution desc BM.Effects let projectGraph = canonicalizePackageGraph (name,version) packageGraph liftIO (File.writeBinary cache projectGraph) diff --git a/src/Pipeline/Crawl/Package.hs b/src/Pipeline/Crawl/Package.hs index db91ea6..d7f38b8 100644 --- a/src/Pipeline/Crawl/Package.hs +++ b/src/Pipeline/Crawl/Package.hs @@ -2,7 +2,7 @@ module Pipeline.Crawl.Package where import Control.Arrow (second) -import Control.Monad.Except (liftIO, throwError, withExceptT) +import Control.Monad.Except (liftIO, throwError) import qualified Data.Map as Map import qualified Elm.Compiler as Compiler import qualified Elm.Compiler.Module as Module @@ -296,12 +296,12 @@ exposedModules -> BM.Task (Map.Map Module.Raw [(Pkg.Name, Pkg.Version)]) exposedModules packageID@(pkgName, version) = within (Path.package pkgName version) $ do - description <- withExceptT BM.PackageProblem (Desc.read Path.description) + description <- Desc.read BM.PackageProblem Path.description let exposed = Desc.exposed description return (foldr insert Map.empty exposed) where insert moduleName dict = - Map.insert moduleName [packageID] dict + Map.insert moduleName [packageID] dict within :: FilePath -> BM.Task a -> BM.Task a