Equational Programming

Table of Contents

Haskell

Application by juxtaposition (F M):

head [1,2]

Partial application:

sum = foldr (+) 0

Anonymous function (λx.x):

\x -> x

Infinite lists:

ones = 1:ones   -- define an infinite list
head ones       -- => 1

Lazy evaluation does leftmost outermost.

If it wasn’t lazy, innermost would fuck shit up:

head (1:ones) → head (1:1:ones) → head (1:1:1:ones) → ... → crap