2

Heard about the new Cats-Effect library here

http://typelevel.org/blog/2017/05/02/io-monad-for-cats.html

Immidiately added the following line to my ammonite shell predef.sc

interp.load.ivy("org.typelevel" % "cats-core_2.12" % "0.9.0")
interp.load.ivy( "org.typelevel" % "cats-effect_2.12" % "0.1-0848c9b")

Now when I load my ammonite shell. I get error

cmd0.sc:1: package cats contains object and package with same name: implicits
one of them needs to be removed from classpath
import cats.effect.IO
       ^
Compilation Failed

Googled and found a solution here

Package contains object and package with same name

But I wonder how can I apply the -Yresolve-term-conflict:strategy to the ammonite shell?

Community
  • 1
  • 1
Knows Not Much
  • 30,395
  • 60
  • 197
  • 373

1 Answers1

1

I was able to solve it myself. Here are the right imports

interp.load.ivy("org.typelevel" %% "cats" % "0.9.0")
interp.load.ivy( "org.typelevel" % "cats-effect_2.12" % "0.1-0848c9b")

Now everything works fine

@ import cats._
import cats._
@ import cats.effect.IO
import cats.effect.IO
@
Knows Not Much
  • 30,395
  • 60
  • 197
  • 373