Skip to content

Instantly share code, notes, and snippets.

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
var jq = document.createElement('script');
// You can change the version number (2.1.0) to any version hosted via Google's Hosted Libraries.
// https://developers.google.com/speed/libraries/devguide#jquery
jq.src = "//ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js";
document.getElementsByTagName('head')[0].appendChild(jq);
// After running the above commands you can run the command below if necessary.
jQuery.noConflict();
@datagrok
datagrok / gist:2199506
Last active April 8, 2023 17:36
Virtualenv's `bin/activate` is Doing It Wrong
@revmischa
revmischa / build-video-server.sh
Created December 16, 2010 00:25
Build and install libx264, libav and rtmpd
#!/usr/bin/env bash
# This script fetches and builds libx264, libav, rtmpd and their dependencies.
# you may have to add /usr/local/lib to /etc/ld.so.conf
# BASEDIR = build directory (default current dir)
# PREFIX = install directory (default /usr/local)
if [ -z "$BASEDIR" ]; then
BASEDIR=`pwd`
fi