-
Make sure you have Java Runtime Environment 1.8 or newer installed (https://www.java.com/en/download/)
-
Download SBT (sbt-extras is recommended)
curl -L -o sbt https://raw.githubusercontent.com/paulp/sbt-extras/master/sbt && chmod +x sbt sudo ln -s $(pwd)/sbt /usr/local/bin/sbt
-
(Optional) Download Ammonite REPL
curl -L -o amm https://git.io/vP4Gw && chmod +x amm sudo ln -s $(pwd)/amm /usr/local/bin/amm
-
(Optional) Install IntelliJ IDEA Community Edition (https://www.jetbrains.com/idea/download)
-
Clone this repository
git clone 'https://github.com/michalsenkyr/scala-course.git'
Slides are available in reveal.js (Czech) as well as in Markdown (Czech)
- Run the
sbt
command in the scala-course/examples directory - Switch to the appropriate subproject (eg.
project variables
) - Run the example:
run
- SBT will automatically find all the runnable classes and gives you a choice of which to run
- For the duplicateFinder subproject, you will need to specify directories to find duplicates in, paths can be either absolute or relative to the duplicateFinder subproject directory:
run test
Run the amm
command in any directory
- variables - Contains examples of defining and using variables (slide 10)
- classes - Contains examples of defining classes/objects and their members (slides 11-18)
- patternMatching - Contains examples of pattern matching (slides 20-21)
- collections - Contains examples of constructing and using collections (slides 22-29)
- forComprehensions - Contains examples of for-comprehensions (slide 30)
- implicits - Contains examples of implicit classes (slide 31)
- duplicateFinder - Contains the solutions for the duplicate file finder exercise (slide 36)
- Solutions include Scala with and without Java 8 as well as pure Java (with and without Java 8) for comparison
- tuplesGame - Contains the solution for the Tuples game exercise (slide 37)