-
Notifications
You must be signed in to change notification settings - Fork 14
/
slides.txt
170 lines (64 loc) · 2.57 KB
/
slides.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
=================================================
BUILD YOUR OWN EXCEL 365 IN AN HOUR WITH F#
Tomas Petricek, University of Kent & fsharpWorks
tomas@tomasp.net | @tomaspetricek
=================================================
=================================================
ELM-STYLE FUNCTIONAL USER INTERFACES
type State = { ... }
type Event = .. | .. | ..
val initial : State
val render : (Event -> unit) -> State -> Html
val update : State -> Event -> State
=================================================
=================================================
COMPOSING PARSERS WITH COMBINATORS
type Parser<'T> =
char list -> ('T * char list) option
<|> : Parser<'T> -> Parser<'T> -> Parser<'T>
<*> : Parser<'T> -> Parser<'S> -> Parser<'T * 'S>
=================================================
=================================================
DISCRIMINATED UNIONS FOR DOMAIN MODELLING
type Expr =
| Number of int
| Binary of Expr * char * Expr
| Reference of Position
=================================================
=================================================
RAILWAY-ORIENTED PROGRAMMING
type Option<'T> = None | Some of 'T
Option.map :
('T -> 'R) -> 'T option -> 'R option
Option.bind :
('T -> 'R option) -> 'T option -> 'R option
=================================================
=================================================
REACTIVE DEPENDENCY GRAPHS
+--------+ +--------+
| A1 = 5 | | C1 = 2 |
+--------+ +--------+
\ /
+------------+
| B3 = A1*C1 |
+------------+
=================================================
=================================================
REACTIVE DEPENDENCY GRAPHS
type Cell =
abstract Value : int
abstract Changed : IObservable<unit>
=================================================
=================================================
BUT IS THIS THE REAL THING?
It's nice you can do all this in one hour,
but is this really what F# programming
looks like in the real world?
=================================================
=================================================
BUILD YOUR OWN EXCEL 365 IN AN HOUR WITH F#
* Elm-style user interfaces with Fable
* Compositional functional programming
* Types for domain modelling and errors
Tomas Petricek, tomas@tomasp.net | @tomaspetricek
=================================================