Skip to content

shehaaz/Scala-from-Scratch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Scala from Scratch

Summarizing the major books on the language

0. Programming in Scala 2nd Edition

  • Code written in the IntelliJ Scala Worksheet

  • Scala Options Explained (YouTube)

    Alt text for your video

  • Scala Futures: In the Scala Standard Library, a Future is a data structure used to retrieve the result of some concurrent operation. This result can be accessed synchronously (blocking) or asynchronously (non-blocking). I will be focusing on the non-blocking futures.

1. Scala in Action

Part 1 Scala: The Basics

Part 2 Working with Scala

Part 3 Advanced Steps

2. Learning Scala

Part 1. Core Scala

Working with Data: Literals, Values, Variables, and Types

Expressions and Conditionals

Functions

First-Class Functions

Collections

Part 2. Object-Oriented Scala

Classes

Objects, Case Classes, and Traits

Case classes are used to conveniently store and match on the contents of a class. You can contruct them without using new

scala> case class Cars(brand: String, model: String) defined class Cars

scala> val tesla1 = Cars("Tesla", "Model-S") tesla1: Cars = Cars(Tesla,Model-S)

Case classes automatically have equality

scala> val tesla2 = Cars("Tesla", "Model-S") tesla2: Cars = Cars(Tesla,Model-S)

scala> tesla1 == tesla2 res0: Boolean = true

Advanced Typing

3. Effective AKKA

HelloWorld example + Article

Ping Pong example + Article

Getting started Scala and Akka

Tutorial: Asynchronous Programming With Akka Actors

Concurrency and Fault Tolerance Made Easy: An Akka Tutorial with Examples

What is an Actor in Akka? An actor is essentially nothing more than an object that receives messages and takes actions. It is decoupled from the source of the message and its only responsibility is to recognize the type of message and take action accordingly.

What type of actions?

  • Execute some operations itself (such as performing calculations, persisting data, calling an external web service, and so on)
  • Forward the message, or a derived message, to another actor
  • Instantiate a new actor and forward the message to it

Akka Demo: count words from text file

Reactive Messaging Patterns explained

4. Functional Programming in Scala

This repository contains exercises, hints, and answers for the book Functional Programming in Scala

5. Scala for the impatient

The apply method is the scala version of a constructor e.g in the class StringOps def apply(n: Int): Char "Hello".apply(4) == "o" "Hello"(4) == "o"

An upper type bound T <: A declares that type variable T refers to a subtype or equal to type A

The lower-bound operator T >: A, restricting types to those that are equal to or are extended by the given type T.

example in Scala Option class:

`final def getOrElse[B >: A](default: => B): B = if (isEmpty) default else this.get`

About

Scala from Scratch

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages