Skip to content

Instantly share code, notes, and snippets.

View gcanti's full-sized avatar

Giulio Canti gcanti

View GitHub Profile
@hallettj
hallettj / HKT.js
Last active June 27, 2019 15:19
Concept for emulating higher-kinded types in Flow via type-level functions
/*
* Concept for emulating higher-kinded types using Flow. Instead of passing
* a type that has not been applied to parameters, this pattern passes
* a type-level function that will map a parameter type to the desired
* higher-kinded type applied to the given parameter.
*
* @flow
*/
// a higher-kinded type is represented indirectly via a type-level function from

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
@josteink
josteink / on_stateful_code.txt
Last active October 21, 2020 05:37
On why stateful code is bad
On why stateful code is bad
===========================
STUDENT: Sir, can I ask a question?
TEACHER: Yes!
STUDENT: How do you put an elephant inside a fridge?
TEACHER: I don't know.
STUDENT: It's easy, you just open the fridge and put it in. I have another question!
TEACHER: Ok, ask.
STUDENT: How to put a donkey inside the fridge?