Skip to content

Instantly share code, notes, and snippets.

Getting Started in Scala

This is my attempt to give Scala newcomers a quick-and-easy rundown to the prerequisite steps they need to a) try Scala, and b) get a standard project up and running on their machine. I'm not going to talk about the language at all; there are plenty of better resources a google search away. This is just focused on the prerequisite tooling and machine setup. I will not be assuming you have any background in JVM languages. So if you're coming from Python, Ruby, JavaScript, Haskell, or anywhere…  I hope to present the information you need without assuming anything.

Disclaimer It has been over a decade since I was new to Scala, and when I was new to Scala, I was coming from a Java and Ruby background. This has probably caused me to unknowingly make some assumptions. Please feel free to call me out in comments/tweets!

One assumption I'm knowingly making is that you're on a Unix-like platform. Sorry, Windows users.

Getting the JVM

Applied Functional Programming with Scala - Notes

Copyright © 2016-2018 Fantasyland Institute of Learning. All rights reserved.

1. Mastering Functions

A function is a mapping from one set, called a domain, to another set, called the codomain. A function associates every element in the domain with exactly one element in the codomain. In Scala, both domain and codomain are types.

val square : Int => Int = x => x * x
@mrenouf
mrenouf / git_merge_meld.sh
Created September 28, 2011 10:09
Merge helper script for using 'git mergetool' with meld, fixes http://stackoverflow.com/questions/7501666/
#!/bin/bash
# Handles proper use of Meld from Git.
#
# Instead of launching meld with $MERGED as the base revision, this
# script makes a copy of $BASE and handles copying the result back
# to $MERGED if the result was saved.
# As an extra tweak, it also presents branch names (if known) as
# the file name prefix, instead of just "LOCAL" and "REMOTE".