Permalink
Browse files

Stop using scalaz.{EitherT, \/}

Use scala.Either instead of \/

Use the custom coursier.util.EitherT instead of scalaz.EitherT
  • Loading branch information...
alexarchambault committed Feb 15, 2018
1 parent 0123a37 commit 1816b25b84670d800b20b2650e4ea1abbb36300f
Showing with 714 additions and 625 deletions.
  1. +3 −5 README.md
  2. +82 −86 cache/src/main/scala/coursier/Cache.scala
  3. +9 −7 cache/src/main/scala/coursier/CacheParse.scala
  4. +5 −3 cache/src/main/scala/coursier/CachePolicy.scala
  5. +14 −10 cache/src/main/scala/coursier/Platform.scala
  6. +5 −5 cli/src/main/scala-2.12/coursier/cli/Helper.scala
  7. +15 −17 cli/src/main/scala-2.12/coursier/cli/scaladex/Scaladex.scala
  8. +2 −3 cli/src/main/scala-2.12/coursier/cli/spark/Assembly.scala
  9. +17 −16 core/shared/src/main/scala/coursier/Fetch.scala
  10. +3 −5 core/shared/src/main/scala/coursier/core/Activation.scala
  11. +2 −3 core/shared/src/main/scala/coursier/core/Repository.scala
  12. +6 −7 core/shared/src/main/scala/coursier/core/Resolution.scala
  13. +6 −6 core/shared/src/main/scala/coursier/core/ResolutionProcess.scala
  14. +5 −8 core/shared/src/main/scala/coursier/core/Versions.scala
  15. +38 −32 core/shared/src/main/scala/coursier/ivy/IvyRepository.scala
  16. +35 −31 core/shared/src/main/scala/coursier/ivy/IvyXml.scala
  17. +12 −9 core/shared/src/main/scala/coursier/ivy/Pattern.scala
  18. +32 −32 core/shared/src/main/scala/coursier/maven/MavenRepository.scala
  19. +237 −189 core/shared/src/main/scala/coursier/maven/Pom.scala
  20. +58 −0 core/shared/src/main/scala/coursier/util/EitherT.scala
  21. +13 −15 core/shared/src/main/scala/coursier/util/Parse.scala
  22. +5 −10 core/shared/src/main/scala/coursier/util/Xml.scala
  23. +3 −5 doc/readme/README.md
  24. +10 −11 extra/src/main/scala/coursier/FallbackDependenciesRepository.scala
  25. +8 −11 fetch-js/src/main/scala/coursier/Platform.scala
  26. +8 −7 sbt-coursier/src/main/scala/coursier/InterProjectRepository.scala
  27. +4 −5 sbt-coursier/src/main/scala/coursier/Keys.scala
  28. +13 −12 sbt-coursier/src/main/scala/coursier/Tasks.scala
  29. +2 −4 sbt-shading/src/main/scala/coursier/Shading.scala
  30. +4 −6 sbt-shared/src/main/scala/coursier/FromSbt.scala
  31. +4 −5 tests/js/src/test/scala/coursier/test/compatibility/package.scala
  32. +1 −1 tests/jvm/src/test/scala/coursier/test/IvyTests.scala
  33. +1 −2 tests/jvm/src/test/scala/coursier/test/ResolutionProcessTests.scala
  34. +6 −7 tests/jvm/src/test/scala/coursier/test/compatibility/package.scala
  35. +7 −9 tests/shared/src/test/scala/coursier/test/ActivationTests.scala
  36. +13 −15 tests/shared/src/test/scala/coursier/test/IvyPatternParserTests.scala
  37. +6 −6 tests/shared/src/test/scala/coursier/test/ParseTests.scala
  38. +13 −14 tests/shared/src/test/scala/coursier/test/PomParsingTests.scala
  39. +7 −6 tests/shared/src/test/scala/coursier/test/TestRepository.scala
@@ -181,10 +181,9 @@ These would mean that the resolution wasn't able to get metadata about some depe
Then fetch and get local copies of the artifacts themselves (the JARs) with
```scala
import java.io.File
import scalaz.\/
import scalaz.concurrent.Task
val localArtifacts: Seq[FileError \/ File] = Task.gatherUnordered(
val localArtifacts: Seq[Either[FileError, File]] = Task.gatherUnordered(
resolution.artifacts.map(Cache.file(_).run)
).unsafePerformSync
```
@@ -509,7 +508,7 @@ res6: coursier.maven.MavenRepository = MavenRepository(https://nexus.corp.com/co
Now that we have repositories, we're going to mix these with things from the `coursier-cache` module,
for resolution to happen via the cache. We'll create a function
of type `Seq[(Module, String)] => F[Seq[((Module, String), Seq[String] \/ (Artifact.Source, Project))]]`.
of type `Seq[(Module, String)] => F[Seq[((Module, String), Either[Seq[String], (Artifact.Source, Project)])]]`.
Given a sequence of dependencies, designated by their `Module` (organisation and name in most cases)
and version (just a `String`), it gives either errors (`Seq[String]`) or metadata (`(Artifact.Source, Project)`),
wrapping the whole in a monad `F`.
@@ -564,10 +563,9 @@ which are dependencies whose versions could not be unified.
Then, if all went well, we can fetch and get local copies of the artifacts themselves (the JARs) with
```scala
import java.io.File
import scalaz.\/
import scalaz.concurrent.Task
val localArtifacts: Seq[FileError \/ File] = Task.gatherUnordered(
val localArtifacts: Seq[Either[FileError, File]] = Task.gatherUnordered(
resolution.artifacts.map(Cache.file(_).run)
).unsafePerformSync
```
Oops, something went wrong.

0 comments on commit 1816b25

Please sign in to comment.