Most of the examples and exercises are come from underscore’s books
- https://underscore.io/books/essential-scala/
- https://underscore.io/books/scala-with-cats/
- https://underscore.io/books/shapeless-guide/
Execute the following command so your sbt can download packages in multi threads
mkdir -p ~/.sbt/1.0/plugins
echo 'addSbtPlugin("io.get-coursier" % "sbt-coursier" % "1.0.0")' >> ~/.sbt/1.0/plugins/plugins.sbt
Run sbt
sbt
Then type compile
and wait all deps download and everything should compile.
If everything compiled, try typing in test
command
All the exercises are well documented and defined in files under test
folder.
Basically just make the following tests compile and all green…
1-class-and-object.scala 2-1-algebraic-data-type.scala 2-2-recursive-data-type.scala 2-3-variance.scala 2-4-typeclasses.scala 2-5-type-enrichment.scala 3-1-functor.scala 3-2-identity-monad.scala 3-3-reader-writer-monad.scala 3-4-state-monad.scala 3-5-monad-transformer.scala 3-6-semigroupal.scala 3-7-validated.scala 3-8-traverse.scala 4-1-kind.scala 4-2-free.scala
all the tests are actually generated from following literal programming org files
- https://github.com/jcouyang/scala-dojo/blob/master/src/test/scala/2-typeclasses.org
- https://github.com/jcouyang/scala-dojo/blob/master/src/test/scala/3-monad.org
- https://github.com/jcouyang/scala-dojo/blob/master/src/test/scala/4-1-kind.org
- https://github.com/jcouyang/scala-dojo/blob/master/src/test/scala/4-2-free.org