HASKELL LANGUAGE REPORT Brett Nelson
John von Neumann
PAUL BERNAYS
ALAN TURING
ALONZO CHURCH
HASKELL CURRY
WHAT DO YOU NOTICE?
Lambda Calculus Stephen Kleene Alonza Church
x.fried-x If we applied chicken to the fryer function like this: x.fried-x chicken => fried-chicken Lambda Fryer Function
0 = λf.λx.x 1 = λf.λx.f(x) 2 = λf.λx.f(f(x)) 3 = λf.λx.f(f(f(x))) 4 = λf.λx.f(f(f(f(x)))) Church Integers
SUCC = λs.λw.λt.w(s w t) Successor Function
SUCC = λs.λw.λt.w(s w t) λs.λw.λt.w(s w t) (λf.λx.x) Successor Function
SUCC = λs.λw.λt.w(s w t) λs.λw.λt.w(s w t) (λf.λx.x) λw.λt.w((λf.λx.x) w t) Successor Function
SUCC = λs.λw.λt.w(s w t) λs.λw.λt.w(s w t) (λf.λx.x) λw.λt.w((λf.λx.x) w t) w.λt.w((λx.x) t) Successor Function
SUCC = λs.λw.λt.w(s w t) λs.λw.λt.w(s w t) (λf.λx.x) λw.λt.w((λf.λx.x) w t) w.λt.w((λx.x) t) λw.λt.w( t ) Successor Function
λw.λt.w( t ) 0 = λf.λx.x 1 = λf.λx.f(x) 2 = λf.λx.f(f(x)) 3 = λf.λx.f(f(f(x))) 4 = λf.λx.f(f(f(f(x)))) Church Integers
qsort( a, lo, hi ) int a[], hi, lo; { int h, l, p, t; if (lo < hi) { l = lo; h = hi; p = a[hi]; do { while ((l < h) && (a[l] <= p)) l = l+1; while ((h > l) && (a[h] >= p)) h = h-1; if (l < h) { t = a[l]; a[l] = a[h]; a[h] = t; } } while (l < h); t = a[l]; a[l] = a[hi]; a[hi] = t; qsort( a, lo, l-1 ); qsort( a, l+1, hi ); } Quicksort
qsort [] = [] qsort (x:xs) = qsort elts_lt_x ++ [x] ++ qsort elts_greq_x where elts_lt_x = [y | y <- xs, y < x] elts_greq_x = [y | y = x] Quicksort
Moore’s Law Physical Limits Why Haskell?
Bottlenecks
If you want to be part of the future of computer science. Learn Haskell and don’t comb your hair. Conclusion