Skip to content

Instantly share code, notes, and snippets.

View arosien's full-sized avatar

Adam Rosien arosien

View GitHub Profile
@noelwelsh
noelwelsh / Limerick.txt
Created December 30, 2015 22:25
Limericks for the digital age
Much software claims to scale horizontally
But don't take to these claims too wantonly
Too often things fail
To properly scale
And marketers talk irresponsibily
@tonymorris
tonymorris / SKI_Applicative.scala
Created August 2, 2012 04:59
Applicative Functor / SKI combinator calculus
object SKI_Applicative {
/*
First, let's talk about the SK combinator calculus and how it contributes to solving your problem.
The SK combinator calculus is made of two functions (aka combinators): S and K. It is sometimes called the SKI combinator calculus, however, the I combinator can be derived from S and K. The key observation of SK is that it is a turing-complete system and therefore, anything that can be expressed as SK is also turing-complete. Here is a demonstration that Scala's type system is turing-complete (and therefore, undecidable) for example[1].
The K combinator is the most trivial of the two. It is sometimes called "const" (as in Haskell). There is also some discussion about its evaluation strategy in Scala and how to best express it[2]. The K function might be paraphrased as, "takes a value and returns a (constant) unary function that always returns that value."
*/
def k[A, B]: A => B => A =
a => _ => a