rigor mortis - yow! conferences...ludwig wittgenstein 13 how far my efforts agree with those of...
TRANSCRIPT
![Page 1: Rigor Mortis - YOW! Conferences...Ludwig Wittgenstein 13 How far my efforts agree with those of other philosophers I will not decide. Indeed what I have here written makes no claim](https://reader035.vdocument.in/reader035/viewer/2022062403/5fe083a244e6ef07f7287ac9/html5/thumbnails/1.jpg)
1
Dav
e Th
omas
@/+
prag
dave
(avoiding)Rigor Mortis
![Page 2: Rigor Mortis - YOW! Conferences...Ludwig Wittgenstein 13 How far my efforts agree with those of other philosophers I will not decide. Indeed what I have here written makes no claim](https://reader035.vdocument.in/reader035/viewer/2022062403/5fe083a244e6ef07f7287ac9/html5/thumbnails/2.jpg)
Dave is anOldFart
http://24.media.tumblr.com/tumblr_lr7ypweBfM1qa9b8ro1_500.png
![Page 3: Rigor Mortis - YOW! Conferences...Ludwig Wittgenstein 13 How far my efforts agree with those of other philosophers I will not decide. Indeed what I have here written makes no claim](https://reader035.vdocument.in/reader035/viewer/2022062403/5fe083a244e6ef07f7287ac9/html5/thumbnails/3.jpg)
Old FartsGet Stuck in Their Ways
http://www.runningheads.net/wp-content/uploads/2013/05/Curmudgeon_Logo.jpg
![Page 4: Rigor Mortis - YOW! Conferences...Ludwig Wittgenstein 13 How far my efforts agree with those of other philosophers I will not decide. Indeed what I have here written makes no claim](https://reader035.vdocument.in/reader035/viewer/2022062403/5fe083a244e6ef07f7287ac9/html5/thumbnails/4.jpg)
http://www.clipartbest.com/clipart-MTLL5pbac 4
So Do Young Ones
![Page 5: Rigor Mortis - YOW! Conferences...Ludwig Wittgenstein 13 How far my efforts agree with those of other philosophers I will not decide. Indeed what I have here written makes no claim](https://reader035.vdocument.in/reader035/viewer/2022062403/5fe083a244e6ef07f7287ac9/html5/thumbnails/5.jpg)
We Get
5
http
://w
ww
.clk
er.c
om/c
lipar
ts/W
/n/3
/A/j/
2/co
mfo
rtab
le-m
an.s
vg
![Page 6: Rigor Mortis - YOW! Conferences...Ludwig Wittgenstein 13 How far my efforts agree with those of other philosophers I will not decide. Indeed what I have here written makes no claim](https://reader035.vdocument.in/reader035/viewer/2022062403/5fe083a244e6ef07f7287ac9/html5/thumbnails/6.jpg)
We Get
6
http
://w
ww
.clk
er.c
om/c
lipar
ts/W
/n/3
/A/j/
2/co
mfo
rtab
le-m
an.s
vg
![Page 7: Rigor Mortis - YOW! Conferences...Ludwig Wittgenstein 13 How far my efforts agree with those of other philosophers I will not decide. Indeed what I have here written makes no claim](https://reader035.vdocument.in/reader035/viewer/2022062403/5fe083a244e6ef07f7287ac9/html5/thumbnails/7.jpg)
7
http
://w
ww
.clk
er.c
om/c
lipar
ts/W
/n/3
/A/j/
2/co
mfo
rtab
le-m
an.s
vg
Maintenance
Programmer
![Page 8: Rigor Mortis - YOW! Conferences...Ludwig Wittgenstein 13 How far my efforts agree with those of other philosophers I will not decide. Indeed what I have here written makes no claim](https://reader035.vdocument.in/reader035/viewer/2022062403/5fe083a244e6ef07f7287ac9/html5/thumbnails/8.jpg)
8
I Got
http
://w
ww
.clk
er.c
om/c
lipar
ts/W
/n/3
/A/j/
2/co
mfo
rtab
le-m
an.s
vg
![Page 9: Rigor Mortis - YOW! Conferences...Ludwig Wittgenstein 13 How far my efforts agree with those of other philosophers I will not decide. Indeed what I have here written makes no claim](https://reader035.vdocument.in/reader035/viewer/2022062403/5fe083a244e6ef07f7287ac9/html5/thumbnails/9.jpg)
The future is functional
The future is concurrent
9
![Page 10: Rigor Mortis - YOW! Conferences...Ludwig Wittgenstein 13 How far my efforts agree with those of other philosophers I will not decide. Indeed what I have here written makes no claim](https://reader035.vdocument.in/reader035/viewer/2022062403/5fe083a244e6ef07f7287ac9/html5/thumbnails/10.jpg)
Is teaching me a new vocabularyIs changing the way I think
10
![Page 11: Rigor Mortis - YOW! Conferences...Ludwig Wittgenstein 13 How far my efforts agree with those of other philosophers I will not decide. Indeed what I have here written makes no claim](https://reader035.vdocument.in/reader035/viewer/2022062403/5fe083a244e6ef07f7287ac9/html5/thumbnails/11.jpg)
Token Appeal to Authority
11
![Page 12: Rigor Mortis - YOW! Conferences...Ludwig Wittgenstein 13 How far my efforts agree with those of other philosophers I will not decide. Indeed what I have here written makes no claim](https://reader035.vdocument.in/reader035/viewer/2022062403/5fe083a244e6ef07f7287ac9/html5/thumbnails/12.jpg)
Ludwig Wittgenstein
12
![Page 13: Rigor Mortis - YOW! Conferences...Ludwig Wittgenstein 13 How far my efforts agree with those of other philosophers I will not decide. Indeed what I have here written makes no claim](https://reader035.vdocument.in/reader035/viewer/2022062403/5fe083a244e6ef07f7287ac9/html5/thumbnails/13.jpg)
Ludwig Wittgenstein
13
How far my efforts agree with those of other philosophers I will not decide. Indeed what I have here written makes no claim to novelty
in points of detail; and therefore I give no sources, because it is indifferent to me
whether what I have thought has already been thought before me by another.
Logico-Tractatus Philosophicus
![Page 14: Rigor Mortis - YOW! Conferences...Ludwig Wittgenstein 13 How far my efforts agree with those of other philosophers I will not decide. Indeed what I have here written makes no claim](https://reader035.vdocument.in/reader035/viewer/2022062403/5fe083a244e6ef07f7287ac9/html5/thumbnails/14.jpg)
Ludwig Wittgenstein Logico-Tractatus Philosophicus
14
How far my efforts agree with those of other philosophers I will not decide. Indeed what I have here written makes no claim to novelty
in points of detail; and therefore I give no sources, because it is indifferent to me
whether what I have thought has already been thought before me by another.
![Page 15: Rigor Mortis - YOW! Conferences...Ludwig Wittgenstein 13 How far my efforts agree with those of other philosophers I will not decide. Indeed what I have here written makes no claim](https://reader035.vdocument.in/reader035/viewer/2022062403/5fe083a244e6ef07f7287ac9/html5/thumbnails/15.jpg)
The limits of my language are the
limits of my worldLudwig Wittgenstein—Logico-Tractatus Philosophicus
15
![Page 16: Rigor Mortis - YOW! Conferences...Ludwig Wittgenstein 13 How far my efforts agree with those of other philosophers I will not decide. Indeed what I have here written makes no claim](https://reader035.vdocument.in/reader035/viewer/2022062403/5fe083a244e6ef07f7287ac9/html5/thumbnails/16.jpg)
16
![Page 17: Rigor Mortis - YOW! Conferences...Ludwig Wittgenstein 13 How far my efforts agree with those of other philosophers I will not decide. Indeed what I have here written makes no claim](https://reader035.vdocument.in/reader035/viewer/2022062403/5fe083a244e6ef07f7287ac9/html5/thumbnails/17.jpg)
How Has Learning Elixir Changed the Way I Think?
17
![Page 18: Rigor Mortis - YOW! Conferences...Ludwig Wittgenstein 13 How far my efforts agree with those of other philosophers I will not decide. Indeed what I have here written makes no claim](https://reader035.vdocument.in/reader035/viewer/2022062403/5fe083a244e6ef07f7287ac9/html5/thumbnails/18.jpg)
Functional |> Concurrent |> Pragmatic |> Fun
![Page 19: Rigor Mortis - YOW! Conferences...Ludwig Wittgenstein 13 How far my efforts agree with those of other philosophers I will not decide. Indeed what I have here written makes no claim](https://reader035.vdocument.in/reader035/viewer/2022062403/5fe083a244e6ef07f7287ac9/html5/thumbnails/19.jpg)
Functional |> Concurrent |> Pragmatic |> Fun
Different
![Page 20: Rigor Mortis - YOW! Conferences...Ludwig Wittgenstein 13 How far my efforts agree with those of other philosophers I will not decide. Indeed what I have here written makes no claim](https://reader035.vdocument.in/reader035/viewer/2022062403/5fe083a244e6ef07f7287ac9/html5/thumbnails/20.jpg)
Background
• Pattern matching
• Functions transform data
20
![Page 21: Rigor Mortis - YOW! Conferences...Ludwig Wittgenstein 13 How far my efforts agree with those of other philosophers I will not decide. Indeed what I have here written makes no claim](https://reader035.vdocument.in/reader035/viewer/2022062403/5fe083a244e6ef07f7287ac9/html5/thumbnails/21.jpg)
Pattern Matcha = 1
{ c, d } = { 2, 3 }
[ e, f, g ] = [ 4, 5, 6 ]
"Elixir " <> rest = "Elixir Rocks!" # rest => "Rocks!"
[ head | tail ] = [ 1, 2, 3, 4, 5, 6 ] # head => 1 # tail => [ 2,3,4,5,6 ]
21
![Page 22: Rigor Mortis - YOW! Conferences...Ludwig Wittgenstein 13 How far my efforts agree with those of other philosophers I will not decide. Indeed what I have here written makes no claim](https://reader035.vdocument.in/reader035/viewer/2022062403/5fe083a244e6ef07f7287ac9/html5/thumbnails/22.jpg)
Pattern Match
case File.open("myfile") do
{ :ok, device } -> IO.read(device, :line)
{ :error, reason } -> IO.puts "FAILED #{reason}"
end
22
![Page 23: Rigor Mortis - YOW! Conferences...Ludwig Wittgenstein 13 How far my efforts agree with those of other philosophers I will not decide. Indeed what I have here written makes no claim](https://reader035.vdocument.in/reader035/viewer/2022062403/5fe083a244e6ef07f7287ac9/html5/thumbnails/23.jpg)
Pattern Matchmy_fun = fn :plus, a, b -> a + b :times, a, b -> a * b end
IO.puts my_fun.(:plus, 3, 4) # => 7 IO.puts my_fun.(:times, 3, 4) # => 12
def other_fun(:minus, a, b), do: a - b def other_fun(:divide, a, b), do: a/b
23
![Page 24: Rigor Mortis - YOW! Conferences...Ludwig Wittgenstein 13 How far my efforts agree with those of other philosophers I will not decide. Indeed what I have here written makes no claim](https://reader035.vdocument.in/reader035/viewer/2022062403/5fe083a244e6ef07f7287ac9/html5/thumbnails/24.jpg)
Pattern Matching• Match based on shape and content
• Destructure data
• Recursive
24
![Page 25: Rigor Mortis - YOW! Conferences...Ludwig Wittgenstein 13 How far my efforts agree with those of other philosophers I will not decide. Indeed what I have here written makes no claim](https://reader035.vdocument.in/reader035/viewer/2022062403/5fe083a244e6ef07f7287ac9/html5/thumbnails/25.jpg)
For example…• fib(0) → 0
• fib(1) → 1
• fib(n) → fib(n-1) + fib(n-2)
25
![Page 26: Rigor Mortis - YOW! Conferences...Ludwig Wittgenstein 13 How far my efforts agree with those of other philosophers I will not decide. Indeed what I have here written makes no claim](https://reader035.vdocument.in/reader035/viewer/2022062403/5fe083a244e6ef07f7287ac9/html5/thumbnails/26.jpg)
Fibonaccidefmodule Fib do
def fib(0), do: 0 def fib(1), do: 1 def fib(n), do: fib(n-1) + fib(n-2)
end
IO.puts Fib.fib(10)
26
![Page 27: Rigor Mortis - YOW! Conferences...Ludwig Wittgenstein 13 How far my efforts agree with those of other philosophers I will not decide. Indeed what I have here written makes no claim](https://reader035.vdocument.in/reader035/viewer/2022062403/5fe083a244e6ef07f7287ac9/html5/thumbnails/27.jpg)
• fib(0) → 0
• fib(1) → 1
• fib(n) → fib(n-1) + fib(n-2)
27
defmodule Fib do def fib(0), do: 0 def fib(1), do: 1 def fib(n), do: fib(n-1) + fib(n-2) end
![Page 28: Rigor Mortis - YOW! Conferences...Ludwig Wittgenstein 13 How far my efforts agree with those of other philosophers I will not decide. Indeed what I have here written makes no claim](https://reader035.vdocument.in/reader035/viewer/2022062403/5fe083a244e6ef07f7287ac9/html5/thumbnails/28.jpg)
Programs Reflect Specification
28
![Page 29: Rigor Mortis - YOW! Conferences...Ludwig Wittgenstein 13 How far my efforts agree with those of other philosophers I will not decide. Indeed what I have here written makes no claim](https://reader035.vdocument.in/reader035/viewer/2022062403/5fe083a244e6ef07f7287ac9/html5/thumbnails/29.jpg)
Programs Reflect Specification
29
Implementation Reflects Transformation
![Page 30: Rigor Mortis - YOW! Conferences...Ludwig Wittgenstein 13 How far my efforts agree with those of other philosophers I will not decide. Indeed what I have here written makes no claim](https://reader035.vdocument.in/reader035/viewer/2022062403/5fe083a244e6ef07f7287ac9/html5/thumbnails/30.jpg)
Length of List
• Length of empty list is zero
• Length of list with head “h” and tail “t” is 1 + length(t)
30
![Page 31: Rigor Mortis - YOW! Conferences...Ludwig Wittgenstein 13 How far my efforts agree with those of other philosophers I will not decide. Indeed what I have here written makes no claim](https://reader035.vdocument.in/reader035/viewer/2022062403/5fe083a244e6ef07f7287ac9/html5/thumbnails/31.jpg)
31
• Length of empty list is zero
• Length of list with head “h” and tail “t” is 1 + length(t)
defmodule MyList do
def len([]), do: 0
def len([ _head | tail ]), do: 1 + len(tail)
end
IO.puts MyList.len [ 5, 4, 3 ]
![Page 32: Rigor Mortis - YOW! Conferences...Ludwig Wittgenstein 13 How far my efforts agree with those of other philosophers I will not decide. Indeed what I have here written makes no claim](https://reader035.vdocument.in/reader035/viewer/2022062403/5fe083a244e6ef07f7287ac9/html5/thumbnails/32.jpg)
Map
• Map of an empty list is an empty list
• Map of list with head “h” and tail “t” is a list whose head is func(h) and whose tail is map(t)
32
![Page 33: Rigor Mortis - YOW! Conferences...Ludwig Wittgenstein 13 How far my efforts agree with those of other philosophers I will not decide. Indeed what I have here written makes no claim](https://reader035.vdocument.in/reader035/viewer/2022062403/5fe083a244e6ef07f7287ac9/html5/thumbnails/33.jpg)
33
defmodule MyList do
def map([], _func), do: []
def map([ h | t ], func), do: [ func.(h) | map(t, func) ]
end
MyList.map [ 1,2,3,4,5], &(&1*&1)
• Map of an empty list is an empty list
• Map of list with head “h” and tail “t” is a list whose head is func(h) and whose tail is map(t)
![Page 34: Rigor Mortis - YOW! Conferences...Ludwig Wittgenstein 13 How far my efforts agree with those of other philosophers I will not decide. Indeed what I have here written makes no claim](https://reader035.vdocument.in/reader035/viewer/2022062403/5fe083a244e6ef07f7287ac9/html5/thumbnails/34.jpg)
More Practical
• Run-length encode a list of values:Runs of two or more of the same value “v” are replaced with { v, count }
[ 1, 2, 2, 2, 3, 4, 4, 5, 6, 6, 6, 6 ]
→ [ 1, {2, 3}, 3, {4, 2}, 5, {6, 4} ]
34
![Page 35: Rigor Mortis - YOW! Conferences...Ludwig Wittgenstein 13 How far my efforts agree with those of other philosophers I will not decide. Indeed what I have here written makes no claim](https://reader035.vdocument.in/reader035/viewer/2022062403/5fe083a244e6ef07f7287ac9/html5/thumbnails/35.jpg)
[ 1, 2, 2, 2, 3, 4, 4, 5, 6, 6, 6, 6 ]
→ [ ]
35
![Page 36: Rigor Mortis - YOW! Conferences...Ludwig Wittgenstein 13 How far my efforts agree with those of other philosophers I will not decide. Indeed what I have here written makes no claim](https://reader035.vdocument.in/reader035/viewer/2022062403/5fe083a244e6ef07f7287ac9/html5/thumbnails/36.jpg)
[ 2, 2, 2, 3, 4, 4, 5, 6, 6, 6, 6 ]
→ [ 1 ]
36
![Page 37: Rigor Mortis - YOW! Conferences...Ludwig Wittgenstein 13 How far my efforts agree with those of other philosophers I will not decide. Indeed what I have here written makes no claim](https://reader035.vdocument.in/reader035/viewer/2022062403/5fe083a244e6ef07f7287ac9/html5/thumbnails/37.jpg)
[ {2,2}, 2, 3, 4, 4, 5, 6, 6, 6, 6 ]
→ [ 1 ]
37
![Page 38: Rigor Mortis - YOW! Conferences...Ludwig Wittgenstein 13 How far my efforts agree with those of other philosophers I will not decide. Indeed what I have here written makes no claim](https://reader035.vdocument.in/reader035/viewer/2022062403/5fe083a244e6ef07f7287ac9/html5/thumbnails/38.jpg)
[ {2,3}, 3, 4, 4, 5, 6, 6, 6, 6 ]
→ [ 1 ]
38
![Page 39: Rigor Mortis - YOW! Conferences...Ludwig Wittgenstein 13 How far my efforts agree with those of other philosophers I will not decide. Indeed what I have here written makes no claim](https://reader035.vdocument.in/reader035/viewer/2022062403/5fe083a244e6ef07f7287ac9/html5/thumbnails/39.jpg)
[ 3, 4, 4, 5, 6, 6, 6, 6 ]
→ [ {2, 3}, 1 ]
39
![Page 40: Rigor Mortis - YOW! Conferences...Ludwig Wittgenstein 13 How far my efforts agree with those of other philosophers I will not decide. Indeed what I have here written makes no claim](https://reader035.vdocument.in/reader035/viewer/2022062403/5fe083a244e6ef07f7287ac9/html5/thumbnails/40.jpg)
[ 4, 4, 5, 6, 6, 6, 6 ]
→ [ 3, {2, 3}, 1 ]
40
![Page 41: Rigor Mortis - YOW! Conferences...Ludwig Wittgenstein 13 How far my efforts agree with those of other philosophers I will not decide. Indeed what I have here written makes no claim](https://reader035.vdocument.in/reader035/viewer/2022062403/5fe083a244e6ef07f7287ac9/html5/thumbnails/41.jpg)
[ {4,2}, 5, 6, 6, 6, 6 ]
→ [ 3, {2, 3}, 1 ]
41
![Page 42: Rigor Mortis - YOW! Conferences...Ludwig Wittgenstein 13 How far my efforts agree with those of other philosophers I will not decide. Indeed what I have here written makes no claim](https://reader035.vdocument.in/reader035/viewer/2022062403/5fe083a244e6ef07f7287ac9/html5/thumbnails/42.jpg)
[ 5, 6, 6, 6, 6 ]
→ [ {4,2} , 3, {2,3}, 1 ]
42
![Page 43: Rigor Mortis - YOW! Conferences...Ludwig Wittgenstein 13 How far my efforts agree with those of other philosophers I will not decide. Indeed what I have here written makes no claim](https://reader035.vdocument.in/reader035/viewer/2022062403/5fe083a244e6ef07f7287ac9/html5/thumbnails/43.jpg)
RLEdefmodule Rle do def encode(list), do: _encode(list, [])
end
RLE.encode [ 1, 2, 2, 2, 3, 4, 4, 5, 6, 6, 6, 6 ]
43
![Page 44: Rigor Mortis - YOW! Conferences...Ludwig Wittgenstein 13 How far my efforts agree with those of other philosophers I will not decide. Indeed what I have here written makes no claim](https://reader035.vdocument.in/reader035/viewer/2022062403/5fe083a244e6ef07f7287ac9/html5/thumbnails/44.jpg)
RLEdefmodule Rle do def encode(list), do: _encode(list, [])
end
RLE.encode [ 1, 2, 2, 2, 3, 4, 4, 5, 6, 6, 6, 6 ]
44
def _encode( [ a | tail ], result) do _encode(tail, [ a | result ]) end
![Page 45: Rigor Mortis - YOW! Conferences...Ludwig Wittgenstein 13 How far my efforts agree with those of other philosophers I will not decide. Indeed what I have here written makes no claim](https://reader035.vdocument.in/reader035/viewer/2022062403/5fe083a244e6ef07f7287ac9/html5/thumbnails/45.jpg)
RLEdefmodule Rle do def encode(list), do: _encode(list, [])
end
RLE.encode [ 1, 2, 2, 2, 3, 4, 4, 5, 6, 6, 6, 6 ]
45
def _encode( [ a | tail ], result) do _encode(tail, [ a | result ]) end
def _encode( [ {a, n}, a | tail ], result) do _encode( [ {a, n+1} | tail ], result ) end
![Page 46: Rigor Mortis - YOW! Conferences...Ludwig Wittgenstein 13 How far my efforts agree with those of other philosophers I will not decide. Indeed what I have here written makes no claim](https://reader035.vdocument.in/reader035/viewer/2022062403/5fe083a244e6ef07f7287ac9/html5/thumbnails/46.jpg)
RLEdefmodule Rle do def encode(list), do: _encode(list, [])
end
RLE.encode [ 1, 2, 2, 2, 3, 4, 4, 5, 6, 6, 6, 6 ]
46
def _encode( [ a | tail ], result) do _encode(tail, [ a | result ]) end
def _encode( [ {a, n}, a | tail ], result) do _encode( [ {a, n+1} | tail ], result ) end
def _encode([ a, a | tail ], result) do _encode( [ {a, 2} | tail ], result ) end
![Page 47: Rigor Mortis - YOW! Conferences...Ludwig Wittgenstein 13 How far my efforts agree with those of other philosophers I will not decide. Indeed what I have here written makes no claim](https://reader035.vdocument.in/reader035/viewer/2022062403/5fe083a244e6ef07f7287ac9/html5/thumbnails/47.jpg)
RLEdefmodule Rle do def encode(list), do: _encode(list, [])
end
RLE.encode [ 1, 2, 2, 2, 3, 4, 4, 5, 6, 6, 6, 6 ]
47
def _encode([], result), do: Enum.reverse(result)
def _encode( [ a | tail ], result) do _encode(tail, [ a | result ]) end
def _encode( [ {a, n}, a | tail ], result) do _encode( [ {a, n+1} | tail ], result ) end
def _encode([ a, a | tail ], result) do _encode( [ {a, 2} | tail ], result ) end
![Page 48: Rigor Mortis - YOW! Conferences...Ludwig Wittgenstein 13 How far my efforts agree with those of other philosophers I will not decide. Indeed what I have here written makes no claim](https://reader035.vdocument.in/reader035/viewer/2022062403/5fe083a244e6ef07f7287ac9/html5/thumbnails/48.jpg)
RLEdefmodule Rle do def encode(list), do: _encode(list, [])
end
RLE.encode [ 1, 2, 2, 2, 3, 4, 4, 5, 6, 6, 6, 6 ]
48
def _encode([], result), do: Enum.reverse(result)
def _encode( [ a | tail ], result) do _encode(tail, [ a | result ]) end
def _encode( [ {a, n}, a | tail ], result) do _encode( [ {a, n+1} | tail ], result ) end
def _encode([ a, a | tail ], result) do _encode( [ {a, 2} | tail ], result ) end
![Page 49: Rigor Mortis - YOW! Conferences...Ludwig Wittgenstein 13 How far my efforts agree with those of other philosophers I will not decide. Indeed what I have here written makes no claim](https://reader035.vdocument.in/reader035/viewer/2022062403/5fe083a244e6ef07f7287ac9/html5/thumbnails/49.jpg)
Input New input Result
[] «done» → [ values ]
[a,a,…] [ {a,2}, … ] → [ values ]
[{a,n}, a, … ] [ {a,n+1}, … ] → [ values ]
[b, …] [ … ] → [ b, values ]
RLE
49
![Page 50: Rigor Mortis - YOW! Conferences...Ludwig Wittgenstein 13 How far my efforts agree with those of other philosophers I will not decide. Indeed what I have here written makes no claim](https://reader035.vdocument.in/reader035/viewer/2022062403/5fe083a244e6ef07f7287ac9/html5/thumbnails/50.jpg)
State New State Result
[] «done» → [ values ]
[a,a,…] [ {a,2}, … ] → [ values ]
[{a,n}, a, … ] [ {a,n+1}, … ] → [ values ]
[b, …] [ … ] → [ b, values ]
RLE
50
![Page 51: Rigor Mortis - YOW! Conferences...Ludwig Wittgenstein 13 How far my efforts agree with those of other philosophers I will not decide. Indeed what I have here written makes no claim](https://reader035.vdocument.in/reader035/viewer/2022062403/5fe083a244e6ef07f7287ac9/html5/thumbnails/51.jpg)
RLEdefmodule Rle do
def encode(list) do list |> Enum.reduce([], &_encode/2) |> Enum.reverse end
def _encode(next, result) do case {next, result} do {a, [ a | rest ] } -> [ {a,2} | rest ] {a, [ {a,n} | rest ] } -> [ {a, n+1} | rest ] {a, rest } -> [ a | rest ] end end end
51
![Page 52: Rigor Mortis - YOW! Conferences...Ludwig Wittgenstein 13 How far my efforts agree with those of other philosophers I will not decide. Indeed what I have here written makes no claim](https://reader035.vdocument.in/reader035/viewer/2022062403/5fe083a244e6ef07f7287ac9/html5/thumbnails/52.jpg)
Not New
• Decision tables (1960s)
• State Machines (1960s)
• Blackboard systems (1980s)
52
![Page 53: Rigor Mortis - YOW! Conferences...Ludwig Wittgenstein 13 How far my efforts agree with those of other philosophers I will not decide. Indeed what I have here written makes no claim](https://reader035.vdocument.in/reader035/viewer/2022062403/5fe083a244e6ef07f7287ac9/html5/thumbnails/53.jpg)
53
1960s
![Page 54: Rigor Mortis - YOW! Conferences...Ludwig Wittgenstein 13 How far my efforts agree with those of other philosophers I will not decide. Indeed what I have here written makes no claim](https://reader035.vdocument.in/reader035/viewer/2022062403/5fe083a244e6ef07f7287ac9/html5/thumbnails/54.jpg)
RLEdefmodule Rle do
def encode(list) do list |> Enum.reduce([], &_encode/2) |> Enum.reverse end
def _encode(next, result) do case {next, result} do {a, [ a | rest ] } -> [ {a,2} | rest ] {a, [ {a,n} | rest ] } -> [ {a, n+1} | rest ] {a, rest } -> [ a | rest ] end end end
54
Transformation
![Page 55: Rigor Mortis - YOW! Conferences...Ludwig Wittgenstein 13 How far my efforts agree with those of other philosophers I will not decide. Indeed what I have here written makes no claim](https://reader035.vdocument.in/reader035/viewer/2022062403/5fe083a244e6ef07f7287ac9/html5/thumbnails/55.jpg)
RLEdefmodule Rle do
def encode(list) do list |> Enum.reduce([], &_encode/2) |> Enum.reverse end
def _encode(next, result) do case {next, result} do {a, [ a | rest ] } -> [ {a,2} | rest ] {a, [ {a,n} | rest ] } -> [ {a, n+1} | rest ] {a, rest } -> [ a | rest ] end end end
55
Event + State
![Page 56: Rigor Mortis - YOW! Conferences...Ludwig Wittgenstein 13 How far my efforts agree with those of other philosophers I will not decide. Indeed what I have here written makes no claim](https://reader035.vdocument.in/reader035/viewer/2022062403/5fe083a244e6ef07f7287ac9/html5/thumbnails/56.jpg)
RLEdefmodule Rle do
def encode(list) do list |> Enum.reduce([], &_encode/2) |> Enum.reverse end
def _encode(next, result) do case {next, result} do {a, [ a | rest ] } -> [ {a,2} | rest ] {a, [ {a,n} | rest ] } -> [ {a, n+1} | rest ] {a, rest } -> [ a | rest ] end end end
56
TransitionsEvent + State
![Page 57: Rigor Mortis - YOW! Conferences...Ludwig Wittgenstein 13 How far my efforts agree with those of other philosophers I will not decide. Indeed what I have here written makes no claim](https://reader035.vdocument.in/reader035/viewer/2022062403/5fe083a244e6ef07f7287ac9/html5/thumbnails/57.jpg)
Markdown
57
System Types ============
These types reflect resources in the underlying Erlang VM.
IDs and Ports -------------
A PID is a reference to a local or remote process, and a port is a reference to a resource (typically external to the application) that you'll be reading or writing.
![Page 58: Rigor Mortis - YOW! Conferences...Ludwig Wittgenstein 13 How far my efforts agree with those of other philosophers I will not decide. Indeed what I have here written makes no claim](https://reader035.vdocument.in/reader035/viewer/2022062403/5fe083a244e6ef07f7287ac9/html5/thumbnails/58.jpg)
Markdown defp parse([ %Line.Blank{}, %Line.Text{content: heading}, %Line.SetextUnderlineHeading{level: level}
| rest ], result) do
parse(rest, [ %Heading{content: heading, level: level} | result ]) end
58
![Page 59: Rigor Mortis - YOW! Conferences...Ludwig Wittgenstein 13 How far my efforts agree with those of other philosophers I will not decide. Indeed what I have here written makes no claim](https://reader035.vdocument.in/reader035/viewer/2022062403/5fe083a244e6ef07f7287ac9/html5/thumbnails/59.jpg)
Large Scale, Too
• REST Service Request: get_special_offers_for_user
• identify user from auth token• find local offers• find national offers• merge and respond
59
} asynchronous
![Page 60: Rigor Mortis - YOW! Conferences...Ludwig Wittgenstein 13 How far my efforts agree with those of other philosophers I will not decide. Indeed what I have here written makes no claim](https://reader035.vdocument.in/reader035/viewer/2022062403/5fe083a244e6ef07f7287ac9/html5/thumbnails/60.jpg)
Find local offers Find national offers
Lookup User
Format response
Request: auth token
Response: . . .
60
![Page 61: Rigor Mortis - YOW! Conferences...Ludwig Wittgenstein 13 How far my efforts agree with those of other philosophers I will not decide. Indeed what I have here written makes no claim](https://reader035.vdocument.in/reader035/viewer/2022062403/5fe083a244e6ef07f7287ac9/html5/thumbnails/61.jpg)
%{ get_offers: auth } -> %{ get_offers: auth, user: user_from(auth) }
%{ get_offers: auth, user: nil } -> %{ respond: :not_authorized }
%{ get_offers: auth, user: user } -> async_get_local_offers(user) async_get_national_offers(user)
%{ get_offers: auth, user_user, national: :error }, -> respond_with_error
%{ get_offers: auth, user_user, local: :error }, -> respond_with_error
%{ get_offers: auth, user_user, national: national, local: local }, -> format_response(user, national, local)
61
![Page 62: Rigor Mortis - YOW! Conferences...Ludwig Wittgenstein 13 How far my efforts agree with those of other philosophers I will not decide. Indeed what I have here written makes no claim](https://reader035.vdocument.in/reader035/viewer/2022062403/5fe083a244e6ef07f7287ac9/html5/thumbnails/62.jpg)
Enough Already
62
![Page 63: Rigor Mortis - YOW! Conferences...Ludwig Wittgenstein 13 How far my efforts agree with those of other philosophers I will not decide. Indeed what I have here written makes no claim](https://reader035.vdocument.in/reader035/viewer/2022062403/5fe083a244e6ef07f7287ac9/html5/thumbnails/63.jpg)
The Point
• Pattern matches are the rules in a state machine
• Each match specifies a transformation of state
• The transformation is the application of functions
63
![Page 64: Rigor Mortis - YOW! Conferences...Ludwig Wittgenstein 13 How far my efforts agree with those of other philosophers I will not decide. Indeed what I have here written makes no claim](https://reader035.vdocument.in/reader035/viewer/2022062403/5fe083a244e6ef07f7287ac9/html5/thumbnails/64.jpg)
Interesting Opportunities
• Easily made parallel
• DSL could define business flow
• granular reuse
• easier testing
• better error handling
64
![Page 65: Rigor Mortis - YOW! Conferences...Ludwig Wittgenstein 13 How far my efforts agree with those of other philosophers I will not decide. Indeed what I have here written makes no claim](https://reader035.vdocument.in/reader035/viewer/2022062403/5fe083a244e6ef07f7287ac9/html5/thumbnails/65.jpg)
Think Differently
65
![Page 66: Rigor Mortis - YOW! Conferences...Ludwig Wittgenstein 13 How far my efforts agree with those of other philosophers I will not decide. Indeed what I have here written makes no claim](https://reader035.vdocument.in/reader035/viewer/2022062403/5fe083a244e6ef07f7287ac9/html5/thumbnails/66.jpg)
Program Differently
66
![Page 67: Rigor Mortis - YOW! Conferences...Ludwig Wittgenstein 13 How far my efforts agree with those of other philosophers I will not decide. Indeed what I have here written makes no claim](https://reader035.vdocument.in/reader035/viewer/2022062403/5fe083a244e6ef07f7287ac9/html5/thumbnails/67.jpg)
Program Differently• New languages are an opportunity
• Let’s not recreate where we came from
• Let’s have fun
67
![Page 68: Rigor Mortis - YOW! Conferences...Ludwig Wittgenstein 13 How far my efforts agree with those of other philosophers I will not decide. Indeed what I have here written makes no claim](https://reader035.vdocument.in/reader035/viewer/2022062403/5fe083a244e6ef07f7287ac9/html5/thumbnails/68.jpg)
68
My name is Inigo Montoya. You killed my programming paradigm. Prepare to learn.
Dave ThomasPragmatic Programmers@/+pragdave