84
LEARNING FUNCTIONAL PROGRAMMING SIMON THOMPSON

Learning Functional Programming - University of Kent · LISP Miranda Elixir Choosing a language . Find a project Reimplement something Try something new Join an Open Source project

  • Upload
    others

  • View
    15

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Learning Functional Programming - University of Kent · LISP Miranda Elixir Choosing a language . Find a project Reimplement something Try something new Join an Open Source project

LEARNING FUNCTIONAL PROGRAMMING

SIMON THOMPSON

Page 2: Learning Functional Programming - University of Kent · LISP Miranda Elixir Choosing a language . Find a project Reimplement something Try something new Join an Open Source project

The essence of functional programming

Beginning to learn functional programming

Resources, advice and bottlenecks

Page 3: Learning Functional Programming - University of Kent · LISP Miranda Elixir Choosing a language . Find a project Reimplement something Try something new Join an Open Source project

THE ESSENCE OF FUNCTIONAL

PROGRAMMING

Page 4: Learning Functional Programming - University of Kent · LISP Miranda Elixir Choosing a language . Find a project Reimplement something Try something new Join an Open Source project

Haskell

Erlang

OCaml

Scala

Elm

F#

Idris

LISPMiranda

Elixir

Page 5: Learning Functional Programming - University of Kent · LISP Miranda Elixir Choosing a language . Find a project Reimplement something Try something new Join an Open Source project
Page 6: Learning Functional Programming - University of Kent · LISP Miranda Elixir Choosing a language . Find a project Reimplement something Try something new Join an Open Source project

pattern matching

data

higher-order functions

recursionlambdastypes

Page 7: Learning Functional Programming - University of Kent · LISP Miranda Elixir Choosing a language . Find a project Reimplement something Try something new Join an Open Source project

pattern matching

data

higher-order functions

recursionlambdastypes

Page 8: Learning Functional Programming - University of Kent · LISP Miranda Elixir Choosing a language . Find a project Reimplement something Try something new Join an Open Source project

pattern matching

data

higher-order functions

recursionlambdastypes

monads

monoids

reactive

lazy

immutability

lenses

DSLs

types, types, types, …

effects

dependent types

Page 9: Learning Functional Programming - University of Kent · LISP Miranda Elixir Choosing a language . Find a project Reimplement something Try something new Join an Open Source project

fun

Page 10: Learning Functional Programming - University of Kent · LISP Miranda Elixir Choosing a language . Find a project Reimplement something Try something new Join an Open Source project

Model the world as data +

Functions over the data +

Functions as data

Page 11: Learning Functional Programming - University of Kent · LISP Miranda Elixir Choosing a language . Find a project Reimplement something Try something new Join an Open Source project

And when I say “function” …

I mean in the mathematical sense, taking inputs to outputs,

and doing nothing else!

Page 12: Learning Functional Programming - University of Kent · LISP Miranda Elixir Choosing a language . Find a project Reimplement something Try something new Join an Open Source project

The approach underlies lots of examples,

Page 13: Learning Functional Programming - University of Kent · LISP Miranda Elixir Choosing a language . Find a project Reimplement something Try something new Join an Open Source project

The approach underlies lots of examples,

libraries, laziness, monads, lenses …

Page 14: Learning Functional Programming - University of Kent · LISP Miranda Elixir Choosing a language . Find a project Reimplement something Try something new Join an Open Source project

Rock-Paper-Scissors

Page 15: Learning Functional Programming - University of Kent · LISP Miranda Elixir Choosing a language . Find a project Reimplement something Try something new Join an Open Source project

Original image: https://www.thishopeanchors.com/single-post/2017/04/06/Rock-Paper-Scissors

Page 16: Learning Functional Programming - University of Kent · LISP Miranda Elixir Choosing a language . Find a project Reimplement something Try something new Join an Open Source project

Original image: https://www.thishopeanchors.com/single-post/2017/04/06/Rock-Paper-Scissors

We choose what to play, depending on

the history of all your moves.

Page 17: Learning Functional Programming - University of Kent · LISP Miranda Elixir Choosing a language . Find a project Reimplement something Try something new Join an Open Source project

Original image: https://www.thishopeanchors.com/single-post/2017/04/06/Rock-Paper-Scissors

data Move = Rock | Paper | Scissors

beat :: [Move] -> Move

beat [] = Rock beat (x:xs) = case x of

    Rock -> Scissors     Paper -> Rock     Scissors -> Paper

We choose what to play, depending on

the history of all your moves.

Page 18: Learning Functional Programming - University of Kent · LISP Miranda Elixir Choosing a language . Find a project Reimplement something Try something new Join an Open Source project

Parsers

Page 19: Learning Functional Programming - University of Kent · LISP Miranda Elixir Choosing a language . Find a project Reimplement something Try something new Join an Open Source project

text parse tree

remaining text

Page 20: Learning Functional Programming - University of Kent · LISP Miranda Elixir Choosing a language . Find a project Reimplement something Try something new Join an Open Source project

text parse tree

remaining text

Page 21: Learning Functional Programming - University of Kent · LISP Miranda Elixir Choosing a language . Find a project Reimplement something Try something new Join an Open Source project

Side-effects

Page 22: Learning Functional Programming - University of Kent · LISP Miranda Elixir Choosing a language . Find a project Reimplement something Try something new Join an Open Source project

input result

store after

store before

Page 23: Learning Functional Programming - University of Kent · LISP Miranda Elixir Choosing a language . Find a project Reimplement something Try something new Join an Open Source project

Delay/force … streams

Page 24: Learning Functional Programming - University of Kent · LISP Miranda Elixir Choosing a language . Find a project Reimplement something Try something new Join an Open Source project

Original image: http://www.metso.com/services/spare-wear-parts-conveyors/conveyor-belts/

Page 25: Learning Functional Programming - University of Kent · LISP Miranda Elixir Choosing a language . Find a project Reimplement something Try something new Join an Open Source project

cons(X,Xs) -> fun() -> {X,Xs} end.

Original image: http://www.metso.com/services/spare-wear-parts-conveyors/conveyor-belts/

head(L) -> case (L()) of {H,_} -> H end.

tail(L) -> case (L()) of {_,T} -> T end.

Page 26: Learning Functional Programming - University of Kent · LISP Miranda Elixir Choosing a language . Find a project Reimplement something Try something new Join an Open Source project

cons(X,Xs) -> fun() -> {X,Xs} end.

-define(cons(X,Xs), fun() -> {X,Xs} end).

Original image: http://www.metso.com/services/spare-wear-parts-conveyors/conveyor-belts/

head(L) -> case (L()) of {H,_} -> H end.

tail(L) -> case (L()) of {_,T} -> T end.

Page 27: Learning Functional Programming - University of Kent · LISP Miranda Elixir Choosing a language . Find a project Reimplement something Try something new Join an Open Source project

github.com/simonjohnthompson/streams

github.com/simonjohnthompson/Interaction

Page 28: Learning Functional Programming - University of Kent · LISP Miranda Elixir Choosing a language . Find a project Reimplement something Try something new Join an Open Source project

type

Page 29: Learning Functional Programming - University of Kent · LISP Miranda Elixir Choosing a language . Find a project Reimplement something Try something new Join an Open Source project

Functions give us expressivity +

Types help to constrain that +

Give a language for modelling

Page 30: Learning Functional Programming - University of Kent · LISP Miranda Elixir Choosing a language . Find a project Reimplement something Try something new Join an Open Source project

BEGINNING FUNCTIONAL

PROGRAMMING

Page 31: Learning Functional Programming - University of Kent · LISP Miranda Elixir Choosing a language . Find a project Reimplement something Try something new Join an Open Source project

data

higher-order functions

lambdastypes

Page 32: Learning Functional Programming - University of Kent · LISP Miranda Elixir Choosing a language . Find a project Reimplement something Try something new Join an Open Source project

pattern matching

data

higher-order functions

recursionlambdastypes

Page 33: Learning Functional Programming - University of Kent · LISP Miranda Elixir Choosing a language . Find a project Reimplement something Try something new Join an Open Source project

Pick any language

Start with the concrete before going to complex abstractions.

Page 34: Learning Functional Programming - University of Kent · LISP Miranda Elixir Choosing a language . Find a project Reimplement something Try something new Join an Open Source project

PATTERN MATCHING

Page 35: Learning Functional Programming - University of Kent · LISP Miranda Elixir Choosing a language . Find a project Reimplement something Try something new Join an Open Source project

type Point = (Float,Float)

data Shape = Circle Point Float | Rectangle Point Float Float

area :: Shape -> Float

area (Circle _ r) = pi*r*r area (Rectangle _ h w) = h*w

Page 36: Learning Functional Programming - University of Kent · LISP Miranda Elixir Choosing a language . Find a project Reimplement something Try something new Join an Open Source project

-type point() :: {float(),float()}.

-type shape() :: {circle,point(),float()} | {rectangle,point(),float(),float()}.

-spec area(shape()) -> float().

area({circle,_,R}) -> math:pi()*R*R; area({rectangle,H,W}) -> H*W.

type Point = (Float,Float)

data Shape = Circle Point Float | Rectangle Point Float Float

area :: Shape -> Float

area (Circle _ r) = pi*r*r area (Rectangle _ h w) = h*w

Page 37: Learning Functional Programming - University of Kent · LISP Miranda Elixir Choosing a language . Find a project Reimplement something Try something new Join an Open Source project

-type point() :: {float(),float()}.

-type shape() :: {circle,point(),float()} | {rectangle,point(),float(),float()}.

-spec area(shape()) -> float().

area({circle,_,R}) -> math:pi()*R*R; area({rectangle,H,W}) -> H*W.

type Point = (Float,Float)

data Shape = Circle Point Float | Rectangle Point Float Float

area :: Shape -> Float

area (Circle _ r) = pi*r*r area (Rectangle _ h w) = h*w

Page 38: Learning Functional Programming - University of Kent · LISP Miranda Elixir Choosing a language . Find a project Reimplement something Try something new Join an Open Source project

PATTERN MATCHING!

Page 39: Learning Functional Programming - University of Kent · LISP Miranda Elixir Choosing a language . Find a project Reimplement something Try something new Join an Open Source project

area :: Shape -> Float

area (Circle _ r) = pi*r*r area (Rectangle _ h w) = h*w

Page 40: Learning Functional Programming - University of Kent · LISP Miranda Elixir Choosing a language . Find a project Reimplement something Try something new Join an Open Source project

area :: Shape -> Float

area (Circle _ r) = pi*r*r area (Rectangle _ h w) = h*w

Link to something more familiar

Page 41: Learning Functional Programming - University of Kent · LISP Miranda Elixir Choosing a language . Find a project Reimplement something Try something new Join an Open Source project

area shape = if is_circle shape then pi*(radius shape)*(radius shape) else height shape * width shape

is_circle :: Shape -> Bool

is_circle (Circle _ _) = True is_circle _ = False

radius, height, width :: Shape -> Float

radius (Circle _ r) = r height (Rectangle _ h _) = h width (Rectangle _ _ w) = w

area :: Shape -> Float

area (Circle _ r) = pi*r*r area (Rectangle _ h w) = h*w

Page 42: Learning Functional Programming - University of Kent · LISP Miranda Elixir Choosing a language . Find a project Reimplement something Try something new Join an Open Source project

area shape = if is_circle shape then pi*(radius shape)*(radius shape) else height shape * width shape

is_circle :: Shape -> Bool

is_circle (Circle _ _) = True is_circle _ = False

radius, height, width :: Shape -> Float

radius (Circle _ r) = r height (Rectangle _ h _) = h width (Rectangle _ _ w) = w

area :: Shape -> Float

area (Circle _ r) = pi*r*r area (Rectangle _ h w) = h*w

Page 43: Learning Functional Programming - University of Kent · LISP Miranda Elixir Choosing a language . Find a project Reimplement something Try something new Join an Open Source project

RECURSION

Page 44: Learning Functional Programming - University of Kent · LISP Miranda Elixir Choosing a language . Find a project Reimplement something Try something new Join an Open Source project

nub :: Eq a => [a] -> [a]

nub [] = []

nub(x:xs) = if elem x xs then nub xs else x : nub xs

The nub of a list is the list with all

duplicates removed.

Page 45: Learning Functional Programming - University of Kent · LISP Miranda Elixir Choosing a language . Find a project Reimplement something Try something new Join an Open Source project

The nub of a list is the list with all

duplicates removed.

nub([]) -> [];

nub([X|Xs]) -> [X|nub(remove(X,Xs))].

remove(_,[]) -> [];

remove(X,[X|Xs]) -> remove(X,Xs);

remove(X,[Y|Xs]) -> [Y|remove(X,Xs)].

Page 46: Learning Functional Programming - University of Kent · LISP Miranda Elixir Choosing a language . Find a project Reimplement something Try something new Join an Open Source project

The nub of a list is the list with all

duplicates removed.

nub([]) -> [];

nub([X|Xs]) -> [X|nub(remove(X,Xs))].

remove(_,[]) -> [];

remove(X,[X|Xs]) -> remove(X,Xs);

remove(X,[Y|Xs]) -> [Y|remove(X,Xs)].

Page 47: Learning Functional Programming - University of Kent · LISP Miranda Elixir Choosing a language . Find a project Reimplement something Try something new Join an Open Source project

RECURSION!

Page 48: Learning Functional Programming - University of Kent · LISP Miranda Elixir Choosing a language . Find a project Reimplement something Try something new Join an Open Source project

nub :: Eq a => [a] -> [a]

nub [] = []

nub(x:xs) = if elem x xs then nub xs else x : nub xs

The nub of a list is the list with all duplicates removed.

Generate all the answers?

nub [] = []

nub [1] = nub (1:[]) = 1 : nub [] = [1]

nub [2,1] = nub (2:[1]) = 2 : nub [1] = [2,1]

nub [1,2,1] = nub (1:[2,1]) = nub [2,1] = [2,1]

Page 49: Learning Functional Programming - University of Kent · LISP Miranda Elixir Choosing a language . Find a project Reimplement something Try something new Join an Open Source project

nub :: Eq a => [a] -> [a]

nub [] = []

nub(x:xs) = if elem x xs then nub xs else x : nub xs

The nub of a list is the list with all duplicates removed.

Generate all the answers?

nub [] = []

nub [1] = nub (1:[]) = 1 : nub [] = [1]

nub [2,1] = nub (2:[1]) = 2 : nub [1] = [2,1]

nub [1,2,1] = nub (1:[2,1]) = nub [2,1] = [2,1]

Page 50: Learning Functional Programming - University of Kent · LISP Miranda Elixir Choosing a language . Find a project Reimplement something Try something new Join an Open Source project

nub :: Eq a => [a] -> [a]

nub [] = []

nub(x:xs) = if elem x xs then nub xs else x : nub xs

The nub of a list is the list with all duplicates removed.

Generate all the answers?

nub [] = []

nub [1] = nub (1:[]) = 1 : nub [] = [1]

nub [2,1] = nub (2:[1]) = 2 : nub [1] = [2,1]

nub [1,2,1] = nub (1:[2,1]) = nub [2,1] = [2,1]

Page 51: Learning Functional Programming - University of Kent · LISP Miranda Elixir Choosing a language . Find a project Reimplement something Try something new Join an Open Source project

nub :: Eq a => [a] -> [a]

nub [] = []

nub(x:xs) = if elem x xs then nub xs else x : nub xs

The nub of a list is the list with all duplicates removed.

Generate all the answers?

nub [] = []

nub [1] = nub (1:[]) = 1 : nub [] = [1]

nub [2,1] = nub (2:[1]) = 2 : nub [1] = [2,1]

nub [1,2,1] = nub (1:[2,1]) = nub [2,1] = [2,1]

Page 52: Learning Functional Programming - University of Kent · LISP Miranda Elixir Choosing a language . Find a project Reimplement something Try something new Join an Open Source project

nub :: Eq a => [a] -> [a]

nub [] = []

nub(x:xs) = if elem x xs then nub xs else x : nub xs

The nub of a list is the list with all duplicates removed.

Rewrite … work “top down” nub [1,2,1] = nub (1:[2,1]) = nub [2,1] = nub (2:[1]) = 2 : nub [1] = 2 : nub (1:[]) = 2 : 1 : nub [] = 2 : 1 : [] = 2 :[1] = [2,1]

Page 53: Learning Functional Programming - University of Kent · LISP Miranda Elixir Choosing a language . Find a project Reimplement something Try something new Join an Open Source project

nub :: Eq a => [a] -> [a]

nub [] = []

nub(x:xs) = if elem x xs then nub xs else x : nub xs

The nub of a list is the list with all duplicates removed.

nub [1,2,1] = nub (1:[2,1]) = nub [2,1] = nub (2:[1]) = 2 : nub [1] = 2 : nub (1:[]) = 2 : 1 : nub [] = 2 : 1 : [] = 2 :[1] = [2,1]

Rewrite … work “top down”

Page 54: Learning Functional Programming - University of Kent · LISP Miranda Elixir Choosing a language . Find a project Reimplement something Try something new Join an Open Source project

nub :: Eq a => [a] -> [a]

nub [] = []

nub(x:xs) = if elem x xs then nub xs else x : nub xs

The nub of a list is the list with all duplicates removed.

nub [1,2,1] = nub (1:[2,1]) = nub [2,1] = nub (2:[1]) = 2 : nub [1] = 2 : nub (1:[]) = 2 : 1 : nub [] = 2 : 1 : [] = 2 :[1] = [2,1]

Rewrite … work “top down”

Page 55: Learning Functional Programming - University of Kent · LISP Miranda Elixir Choosing a language . Find a project Reimplement something Try something new Join an Open Source project

nub :: Eq a => [a] -> [a]

nub [] = []

nub(x:xs) = if elem x xs then nub xs else x : nub xs

The nub of a list is the list with all duplicates removed.

nub [1,2,1] = nub (1:[2,1]) = nub [2,1] = nub (2:[1]) = 2 : nub [1] = 2 : nub (1:[]) = 2 : 1 : nub [] = 2 : 1 : [] = 2 :[1] = [2,1]

Rewrite … work “top down”

Page 56: Learning Functional Programming - University of Kent · LISP Miranda Elixir Choosing a language . Find a project Reimplement something Try something new Join an Open Source project

nub :: Eq a => [a] -> [a]

nub [] = []

nub(x:xs) = if elem x xs then nub xs else x : nub xs

The nub of a list is the list with all duplicates removed.

nub [1,2,1] = nub (1:[2,1]) = nub [2,1] = nub (2:[1]) = 2 : nub [1] = 2 : nub (1:[]) = 2 : 1 : nub [] = 2 : 1 : [] = 2 :[1] = [2,1]

Rewrite … work “top down”

Page 57: Learning Functional Programming - University of Kent · LISP Miranda Elixir Choosing a language . Find a project Reimplement something Try something new Join an Open Source project

nub :: Eq a => [a] -> [a]

nub [] = []

nub(x:xs) = if elem x xs then nub xs else x : nub xs

The nub of a list is the list with all duplicates removed.

nub [1,2,1] = nub (1:[2,1]) = nub [2,1] = nub (2:[1]) = 2 : nub [1] = 2 : nub (1:[]) = 2 : 1 : nub [] = 2 : 1 : [] = 2 :[1] = [2,1]

Rewrite … work “top down”

Page 58: Learning Functional Programming - University of Kent · LISP Miranda Elixir Choosing a language . Find a project Reimplement something Try something new Join an Open Source project

nub :: Eq a => [a] -> [a]

nub [] = []

nub(x:xs) = if elem x xs then nub xs else x : nub xs

The nub of a list is the list with all duplicates removed.

nub [1,2,1] = nub (1:[2,1]) = nub [2,1] = nub (2:[1]) = 2 : nub [1] = 2 : nub (1:[]) = 2 : 1 : nub [] = 2 : 1 : [] = 2 :[1] = [2,1]

Rewrite … work “top down”

Page 59: Learning Functional Programming - University of Kent · LISP Miranda Elixir Choosing a language . Find a project Reimplement something Try something new Join an Open Source project

nub :: Eq a => [a] -> [a]

nub [] = []

nub(x:xs) = if elem x xs then nub xs else x : nub xs

The nub of a list is the list with all duplicates removed.

nub [1,2,1] = nub (1:[2,1]) = nub [2,1] = nub (2:[1]) = 2 : nub [1] = 2 : nub (1:[]) = 2 : 1 : nub [] = 2 : 1 : [] = 2 :[1] = [2,1]

Rewrite … work “top down”

Page 60: Learning Functional Programming - University of Kent · LISP Miranda Elixir Choosing a language . Find a project Reimplement something Try something new Join an Open Source project

nub :: Eq a => [a] -> [a]

nub [] = []

nub(x:xs) = if elem x xs then nub xs else x : nub xs

The nub of a list is the list with all duplicates removed.

nub [1,2,1] = nub (1:[2,1]) = nub [2,1] = nub (2:[1]) = 2 : nub [1] = 2 : nub (1:[]) = 2 : 1 : nub [] = 2 : 1 : [] = 2 :[1] = [2,1]

Rewrite … work “top down”

Page 61: Learning Functional Programming - University of Kent · LISP Miranda Elixir Choosing a language . Find a project Reimplement something Try something new Join an Open Source project

nub :: Eq a => [a] -> [a]

nub [] = []

nub(x:xs) = if elem x xs then nub xs else x : nub xs

The nub of a list is the list with all duplicates removed.

nub [1,2,1] = nub (1:[2,1]) = nub [2,1] = nub (2:[1]) = 2 : nub [1] = 2 : nub (1:[]) = 2 : 1 : nub [] = 2 : 1 : [] = 2 :[1] = [2,1]

Rewrite … work “top down”

Page 62: Learning Functional Programming - University of Kent · LISP Miranda Elixir Choosing a language . Find a project Reimplement something Try something new Join an Open Source project

Accept the template: the lists get shorter …

nub :: Eq a => [a] -> [a]

nub [] = []

nub(x:xs) = if elem x xs then nub xs else x : nub xs

The nub of a list is the list with all duplicates removed.

foo [] = … foo (x:xs) = … x … foo xs …

Page 63: Learning Functional Programming - University of Kent · LISP Miranda Elixir Choosing a language . Find a project Reimplement something Try something new Join an Open Source project

Accept the template: the lists get shorter …

nub :: Eq a => [a] -> [a]

nub [] = []

nub(x:xs) = if elem x xs then nub xs else x : nub xs

The nub of a list is the list with all duplicates removed.

foo [] = … foo (x:xs) = … x … foo xs …

… and look at some examplesnub [1,2] = [1,2] nub [2,1,2] = [1,2]

Page 64: Learning Functional Programming - University of Kent · LISP Miranda Elixir Choosing a language . Find a project Reimplement something Try something new Join an Open Source project

How to get started (with recursion)?

Examples, examples, examples. From simple “five finger” exercises,

to a favourite small library.

Page 65: Learning Functional Programming - University of Kent · LISP Miranda Elixir Choosing a language . Find a project Reimplement something Try something new Join an Open Source project

RESOURCES

Page 66: Learning Functional Programming - University of Kent · LISP Miranda Elixir Choosing a language . Find a project Reimplement something Try something new Join an Open Source project
Page 67: Learning Functional Programming - University of Kent · LISP Miranda Elixir Choosing a language . Find a project Reimplement something Try something new Join an Open Source project
Page 68: Learning Functional Programming - University of Kent · LISP Miranda Elixir Choosing a language . Find a project Reimplement something Try something new Join an Open Source project
Page 69: Learning Functional Programming - University of Kent · LISP Miranda Elixir Choosing a language . Find a project Reimplement something Try something new Join an Open Source project
Page 70: Learning Functional Programming - University of Kent · LISP Miranda Elixir Choosing a language . Find a project Reimplement something Try something new Join an Open Source project
Page 71: Learning Functional Programming - University of Kent · LISP Miranda Elixir Choosing a language . Find a project Reimplement something Try something new Join an Open Source project
Page 72: Learning Functional Programming - University of Kent · LISP Miranda Elixir Choosing a language . Find a project Reimplement something Try something new Join an Open Source project
Page 73: Learning Functional Programming - University of Kent · LISP Miranda Elixir Choosing a language . Find a project Reimplement something Try something new Join an Open Source project

Online

Wiki-books, MOOCs, video channels, try-XXX,

tutorials …

Page 74: Learning Functional Programming - University of Kent · LISP Miranda Elixir Choosing a language . Find a project Reimplement something Try something new Join an Open Source project
Page 75: Learning Functional Programming - University of Kent · LISP Miranda Elixir Choosing a language . Find a project Reimplement something Try something new Join an Open Source project
Page 76: Learning Functional Programming - University of Kent · LISP Miranda Elixir Choosing a language . Find a project Reimplement something Try something new Join an Open Source project

Working together

XXX-bridge, code clubs, meet-ups, reading groups…

Page 77: Learning Functional Programming - University of Kent · LISP Miranda Elixir Choosing a language . Find a project Reimplement something Try something new Join an Open Source project

AND THEN …

Page 78: Learning Functional Programming - University of Kent · LISP Miranda Elixir Choosing a language . Find a project Reimplement something Try something new Join an Open Source project

Pick any language

Start with the concrete before going to complex abstractions.

Page 79: Learning Functional Programming - University of Kent · LISP Miranda Elixir Choosing a language . Find a project Reimplement something Try something new Join an Open Source project

Haskell

Erlang

OCaml

Scala

Elm

F#

Idris

LISPMiranda

Elixir

Choosing a language

Page 80: Learning Functional Programming - University of Kent · LISP Miranda Elixir Choosing a language . Find a project Reimplement something Try something new Join an Open Source project

Find a project

Reimplement something Try something new

Join an Open Source project

Page 81: Learning Functional Programming - University of Kent · LISP Miranda Elixir Choosing a language . Find a project Reimplement something Try something new Join an Open Source project

Systems

Page 82: Learning Functional Programming - University of Kent · LISP Miranda Elixir Choosing a language . Find a project Reimplement something Try something new Join an Open Source project

Abstraction This board belongs to Newcastle University PhD student Tom Fisher, who is doing research in homological algebra.

Thanks to Christian Perfect for the photo.whatsonmyblackboard.wordpress.com

Page 83: Learning Functional Programming - University of Kent · LISP Miranda Elixir Choosing a language . Find a project Reimplement something Try something new Join an Open Source project

Enjoy!

Type-driven development Functional Concurrency

Systems programming in ML

Page 84: Learning Functional Programming - University of Kent · LISP Miranda Elixir Choosing a language . Find a project Reimplement something Try something new Join an Open Source project

LEARNING FUNCTIONAL PROGRAMMING

SIMON THOMPSON