Skip to content

Commit

Permalink
Update for latest elm-package public API for descriptions and solutions
Browse files Browse the repository at this point in the history
  • Loading branch information
process-bot committed Jun 1, 2016
1 parent 5f7b745 commit 45321cd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
12 changes: 5 additions & 7 deletions src/Pipeline/Crawl.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand All @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions src/Pipeline/Crawl/Package.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 45321cd

Please sign in to comment.