Skip to content

Instantly share code, notes, and snippets.

View pvillega's full-sized avatar
😶‍🌫️
Too much!

Pere Villega pvillega

😶‍🌫️
Too much!
View GitHub Profile

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
@jordiclariana
jordiclariana / pre-commit.sh
Last active January 22, 2016 11:53
Pre commit for scala projects (sergigp review)
#!/bin/bash
declare -A COLORS
COLORS[RED]='\033[0;31m'
COLORS[GREEN]='\033[0;32m'
COLORS[NC]='\033[0m'
COLORS[WHITE]='\033[1m'
# Print a string using colors
# $1 The color
@keeguon
keeguon / countries.json
Created April 5, 2012 11:11
A list of countries in JSON
[
{name: 'Afghanistan', code: 'AF'},
{name: 'Åland Islands', code: 'AX'},
{name: 'Albania', code: 'AL'},
{name: 'Algeria', code: 'DZ'},
{name: 'American Samoa', code: 'AS'},
{name: 'AndorrA', code: 'AD'},
{name: 'Angola', code: 'AO'},
{name: 'Anguilla', code: 'AI'},
{name: 'Antarctica', code: 'AQ'},