Skip to content

leszekgruchala/scala-fast-track

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

46 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Fast track to Scala

Code examples here are a base for my presentation to Java fellows. This presentation is about to show Scala in possibly fast way allowing you to get your hands dirty. There is no aim to cover everything extensively, but give enough to understand the concept.

Whilst working on it, I got an idea this code can be a good introduction for people coming to Scala from other languages, that's why you will find short comments explaining the code. It's hard to find such concise resources around the web so it's worthwhile to make one. Maybe except cheat sheets but they are too short and you can't play with them!

Examples are run on test specification so install SBT and from command line run all tests with tests or single one with ~testOnly *.MethodsAndFunctionsSpec

You can paste code to REPL too (with :paste command) or from sbt run with main app with runMain eu.gruchala.scala.Main and play around.

Feel free to join forces, update code, add more things. We can talk at Gitter

Covered

  • definitions: Pure function, referentially transparent
  • argument pass by value/by name
  • function literals
  • val vs var vs def vs lazy val
  • equality
  • partial functions
  • partially applied functions
  • case classes
  • classes and companion objects
  • default values
  • value classes
  • objects
  • traits
  • multiple traits inheritance
  • function composition
  • pattern matching
  • recursion / tail recursion
  • for comprehensions
  • implicits (function arguments, functions, implicitly)
  • underscore use cases
  • Future
  • Try
  • Either
  • type variances

Missing

  • Promise
  • More functional examples
  • you name it

More advanced topics covered in another repo: typelevel-programming-scala

License

MIT License

About

Fastest way to understand Scala basics and play with it.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages