-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
460 lines (402 loc) · 14.6 KB
/
index.html
File metadata and controls
460 lines (402 loc) · 14.6 KB
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
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=EB+Garamond:ital,wght@0,400..800;1,400..800&display=swap"
rel="stylesheet">
<script type="text/javascript" src="https://payhip.com/payhip.js"></script>
<title>Functional Programming Strategies</title>
<style>
:root {
/* Tailwind colors */
--color-gray-50: oklch(0.985 0.002 247.839);
--color-gray-100: oklch(0.967 0.003 264.542);
--color-gray-200: oklch(0.928 0.006 264.531);
--color-gray-300: oklch(0.872 0.01 258.338);
--color-gray-400: oklch(0.707 0.022 261.325);
--color-gray-500: oklch(0.551 0.027 264.364);
--color-gray-600: oklch(0.446 0.03 256.802);
--color-gray-700: oklch(0.373 0.034 259.733);
--color-gray-800: oklch(0.278 0.033 256.848);
--color-gray-900: oklch(0.21 0.034 264.665);
--color-gray-950: oklch(0.13 0.028 261.692);
--color-emerald-50: oklch(0.979 0.021 166.113);
--color-emerald-100: oklch(0.95 0.052 163.051);
--color-emerald-200: oklch(0.905 0.093 164.15);
--color-emerald-300: oklch(0.845 0.143 164.978);
--color-emerald-400: oklch(0.765 0.177 163.223);
--color-emerald-500: oklch(0.696 0.17 162.48);
--color-emerald-600: oklch(0.596 0.145 163.225);
--color-emerald-700: oklch(0.508 0.118 165.612);
--color-emerald-800: oklch(0.432 0.095 166.913);
--color-emerald-900: oklch(0.378 0.077 168.94);
--color-emerald-950: oklch(0.262 0.051 172.552);
--accent-color: var(--color-emerald-600);
--accent-color-focus: var(--color-emerald-500);
--default-text: var(--color-gray-800);
--scale-ratio: 1.25;
--text-base: 1rem;
--text-sm: calc(var(--text-base) / var(--scale-ratio));
--text-md: calc(var(--text-base) * var(--scale-ratio));
--text-lg: calc(var(--text-md) * var(--scale-ratio));
--text-xl: calc(var(--text-lg) * var(--scale-ratio));
--text-2xl: calc(var(--text-xl) * var(--scale-ratio));
--text-3xl: calc(var(--text-2xl) * var(--scale-ratio));
--text-4xl: calc(var(--text-3xl) * var(--scale-ratio));
--margin-top: 0.5em;
--margin-bottom: 0.25em;
font-size: 100%;
}
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
line-height: 1.6;
color: var(--default-text);
background: white;
}
h1,
h2,
h4,
h4,
h5 {
font-family: 'EB Garamond';
color: var(--accent-color);
margin-top: var(--margin-top);
margin-bottom: var(--margin-bottom);
}
h1, h2, h3 {
line-height: 1.2;
}
h4, h5, h6 {
line-height: 1.3;
}
h1 {
font-size: var(--text-4xl);
font-weight: 700;
}
h2 {
font-size: var(--text-3xl);
}
h3 {
font-size: var(--text-2xl);
}
h4 {
font-size: var(--text-xl);
}
p {
color: var(--default-text);
margin-top: var(--margin-top);
margin-bottom: var(--margin-bottom);
}
a {
color: var(--accent-color);
text-decoration: underline dotted;
&:hover {
color: var(--accent-color-focus);
text-decoration: underline;
}
}
button {
padding: 15px 40px;
font-size: 1rem;
font-weight: 600;
background: var(--accent-color);
color: white;
border: none;
border-color: var(--accent-color);
border-radius: 8px;
cursor: pointer;
&:hover {
border-color: var(--accent-color-focus);
background: var(--accent-color-focus);
}
&.muted {
background: none;
color: var(--accent-color);
border: none;
border-color: var(--accent-color);
&:hover {
color: var(--accent-color-focus);
border-color: var(--accent-color-focus);
}
}
a {
color: white;
text-decoration: none;
}
}
.text-sm {
font-size: var(--text-sm);
}
.text-muted {
color: var(--color-gray-300);
}
.center {
text-align: center;
}
.mt-2 {
margin-top: calc(var(--margin-top) * 2);
}
.mt-3 {
margin-top: calc(var(--margin-top) * 3);
}
.mt-4 {
margin-top: calc(var(--margin-top) * 4);
}
.mt-5 {
margin-top: calc(var(--margin-top) * 5);
}
.mt-6 {
margin-top: calc(var(--margin-top) * 6);
}
.top-bar {
background: linear-gradient(90deg, var(--accent-color) 0%, hsl(from var(--accent-color) h s calc(l * 1.4)) 100%);
height: 7px;
}
.hero {
background: var(--color-emerald-50);
padding: 80px 20px;
.subtitle {
font-size: var(--text-xl);
font-weight: 500;
color: var(--default-text)
}
.byline {
font-size: var(--text-xl);
font-weight: 500;
color: var(--default-text)
}
}
.container {
max-width: 800px;
margin: 0 auto;
}
.accent {
color: var(--accent-color);
}
.section {
padding: 60px 20px;
}
.about {
background: white;
}
.features {
background: var(--color-gray-50);
}
.feature-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
gap: 30px;
}
.feature-item {
padding: 30px;
background: white;
border-radius: 10px;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}
.email-signup {
background: white;
.signup-form {
max-width: 640px;
margin: 0 auto;
display: flex;
gap: 10px;
flex-wrap: wrap;
justify-content: center;
margin-top: 30px;
margin-bottom: 10px;
}
input[type="email"] {
flex: 1;
min-width: 250px;
padding: 15px 20px;
font-size: 1rem;
border: 2px solid var(--color-gray-300);
border-radius: 8px;
transition: border-color 0.3s;
}
input[type="email"]:focus {
outline: none;
border-color: var(--accent-color);
}
}
footer {
background: var(--color-emerald-50);
font-size: 0.8em;
text-align: center;
padding: 30px 20px;
p {
margin-bottom: 0px;
color: var(--color-emerald-700);
}
.sparkle:hover {
filter: brightness(1.2);
text-shadow: 0px 0px 7px hotpink;
}
}
@media (max-width: 768px) {
:root {
--scale-ratio: 1.15;
--text-sm: calc(var(--text-base) / var(--scale-ratio));
--text-md: calc(var(--text-base) * var(--scale-ratio));
--text-lg: calc(var(--text-md) * var(--scale-ratio));
--text-xl: calc(var(--text-lg) * var(--scale-ratio));
--text-2xl: calc(var(--text-xl) * var(--scale-ratio));
--text-3xl: calc(var(--text-2xl) * var(--scale-ratio));
--text-4xl: calc(var(--text-3xl) * var(--scale-ratio));
}
.signup-form {
flex-direction: column;
}
input[type="email"] {
min-width: 100%;
}
}
</style>
</head>
<body>
<div class="top-bar"></div>
<section class="hero">
<div class="container">
<h1><span class="accent">Functional Programming</span> Strategies</h1>
<h2 class="subtitle">Mental models for better code</h2>
<h2 class="byline">A book by <span class="accent"><a href="https://noelwelsh.com/">Noel Welsh</a></span></h2>
<p class="mt-4">
<a href="https://payhip.com/b/8j14U" class="payhip-buy-button" data-theme="none" data-product="8j14U"><button>Buy the draft PDF</button></a>
</p>
<p class="text-sm">You'll receive an update with every new version.</p>
<p class="mt-4">The book is currently a draft.
You can <a href="functionalprogrammingstrategies/functional-programming-strategies-preview.pdf">read a free sample</a>,
or <a href="#email-signup">join the mailing list</a> to hear when it's released.
If you have suggestions or spot a mistake, please
<a href="https://github.com/functionalprogrammingstrategies/functionalprogrammingstrategies/issues">open an issue</a>.
</p>
</div>
</section>
<section class="section about">
<div class="container">
<h2>About the Book</h2>
<p>Most programming books teach syntax; <em>Functional Programming
Strategies</em> teaches you how to think.
The right mental models lead naturally to better code,
and functional programming's theoretical foundations provide exceptionally
useful mental models—ones that scale from simple functions to complex
systems.
Over 25 years of professional programming I've refined a mental toolkit
that I call functional programming strategies.
These strategies form the core of the book.
For example, “types as constraints” is the
strategy of representing semantic constraints in the type system, while
“following the types” is the strategy of using type information to guide
the implementation.
Every strategy is illustrated with practical case
studies showing how they apply to real code.</p>
<p>To get the most from <em>Functional Programming Strategies</em> you
should be proficient with a programming language and ready
to dive into where theory and practice meet. This is not an
introductory programming book, but one on the deep concepts and
connections behind programming. The book's examples use <a
href="https://www.scala-lang.org/">Scala</a>—its expressivity
makes it easy to demonstrate the strategies, while its industry adoption
means you can apply these techniques immediately in production code.
The strategies, however, are language agnostic and translate to other
modern typed languages, such as <a
href="https://rust-lang.org/">Rust</a>, <a
href="https://kotlinlang.org/">Kotlin</a>, <a
href="https://ocaml.org/">OCaml</a>, or <a
href="https://www.typescriptlang.org/">Typescript</a>.</p>
<p>If you are after a systematic way to create code, rather than relying
on trial and error,
<a href="https://payhip.com/b/8j14U">buy the draft PDF</a>
or <a href="#email-signup">sign up to the mailing list</a> to be notified when the book is released.</p>
</div>
</section>
<section class="section features">
<div class="container">
<h2>What You'll Learn</h2>
<div class="feature-grid">
<div class="feature-item">
<h4>Data and Codata</h4>
<p>Learn to represent concepts in code as data or codata,
how to choose between the two based on extensibility
requirements, and how to translate from one to the
other.</p>
</div>
<div class="feature-item">
<h4>Practical Examples</h4>
<p>Real-world code examples covering core programming
concerns such as error handling and complete systems
such as a stream-processing engine.</p>
</div>
<div class="feature-item">
<h4>Type Classes</h4>
<p>Learn how type classes provide a novel form of extensibility.
Understand core type classes such as monoids, applicative functors, and monads, and how to use
them as both code level abstractions and as conceptual tools for program design.</p>
</div>
<div class="feature-item">
<h4>Dualities</h4>
<p>See how dualities—bidirectional program transformations—can be used as an organizing
principle and as a tool for program design.
Explore the dualities between data and codata, direct-style and continuation-passing style, and
more in practical case studies.
</p>
</div>
<div class="feature-item">
<h4>Interpreters</h4>
<p>Learn how interpreters can be used to handle effects in a functional style,
and see the major implementation strategies and approaches to optimization.
Solve the “expression problem” with extremely flexible tagless final style
interpreters.
</p>
</div>
<div class="feature-item">
<h4>A Whole Lot More</h4>
<p>This just scratches the surface of what's in the book.
At over 500 pages it's a comprehensive reference for all the major concepts and techniques used
by experts.
</p>
<p>
<a href="functionalprogrammingstrategies/functional-programming-strategies-preview.pdf">Read the free preview</a>
for the full table of contents and sample chapters.
</p>
</div>
</div>
</div>
</section>
<section id="email-signup" class="section email-signup">
<div class="container">
<h2>Stay Updated</h2>
<p>The book will be launched in 2026. Get notified when it launches and
receive exclusive updates. We'll never share your email address with
anyone else.</p>
<form
action="https://buttondown.email/api/emails/embed-subscribe/functionalprogrammingstrategies"
method="post"
target="popupwindow"
onsubmit="window.open('https://buttondown.email/functionalprogrammingstrategies', 'popupwindow')"
class="signup-form"
>
<input type="email" name="email" id="bd-email" placeholder="Enter your email address">
<input type="hidden" value="1" name="embed"></input>
<button type="submit">Notify Me</button>
</form>
<p class="center text-sm text-muted">
<a href="https://buttondown.email" target="_blank">Powered by Buttondown.</a>
</p>
</div>
</section>
<footer>
<div class="container">
<p>© Copyright 2026 Noel Welsh. Built with <span class="sparkle">💖</span>. All rights reserved.</p>
</div>
</footer>
</body>
</html>