Skip to content

Introduces some Scala contexts which are less common in other languages

Notifications You must be signed in to change notification settings

armakuni/unfamiliar-scala

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Unfamiliar Scala Features

If you are coming to Scala from other languages, there are a few things that might not be familiar. This repository contains some examples to introduce you.

Note: Examples are using Scala 2

Recommended Order

  1. Placeholders
  2. Currying
  3. InfixNotation
  4. OOPStuff
  5. CaseClasses
  6. Implicits
  7. ForComprehensions

Running

Scala project typically use the sbt tool to maintain dependencies and build configurations. It's primary configuration lives in build.sbt in your project root.

You can run sbt run to run your project (since there are multiple main functions in this project, you will be given an option on which to run).

sbt shell

You can also just run sbt to start up the sbt shell.

Here you can execute run to re-run the code without waiting for sbt to restart.

You can also use the reload command to load any changes.

You can also use runMain Placeholders to specifically run the main function in the Placeholders object.

If you prefix any command with a ~ (e.g. ~runMain Impicits) then sbt will watch for file changes and automatically re-run the command.

There are plenty of other sbt commands and you can define build targets, for example test would run tests if there were any.

About

Introduces some Scala contexts which are less common in other languages

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages