Reputation: 41939
Given the following SBT files:
$cat shapeless_sandbox/build.sbt
name := "shapeless sandbox"
scalaVersion := "2.11.5"
libraryDependencies ++= Seq(
"com.chuusai" %% "shapeless" % "2.1.0-RC1"
)
resolvers ++= Seq(
Resolver.sonatypeRepo("releases"),
Resolver.sonatypeRepo("snapshots")
)
// Fork JVM when `run`-ing SBT
// http://stackoverflow.com/a/5265162/409976
fork in run := true
And the SBT version:
$cat shapeless_sandbox/project/build.properties
sbt.version=0.13.7
Running sbt
, update
, and then console
, I can't run the examples from the Feature Overview.
scala> import poly._
<console>:7: error: not found: value poly
import poly._
^
What am I missing?
Upvotes: 1
Views: 266
Reputation: 139058
When you check out the Shapeless repository and launch a REPL from that directory, this command (from the SBT build configuration) will be executed:
initialCommands in console := """import shapeless._"""
If you're simply depending on Shapeless in your own project, you won't get the same effect. You could add this line to your build, but it's much more common just to import shapeless._
manually when you start the REPL. Once you've done that, import poly._
(which is a relative import for the contents of the shapeless.poly
package) will work just fine.
Upvotes: 1