3 <link rel=
"stylesheet" href=
"css/csshake.min.css">
4 <link href=
"https://fonts.googleapis.com/css?family=Press+Start+2P&display=swap" rel=
"stylesheet">
6 href=
"https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.18.1/styles/atom-one-dark.min.css">
7 <script src=
"https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.18.1/highlight.min.js"></script>
8 <script>hljs.initHighlightingOnLoad();
</script>
9 <title>Crazy Wide-Eyed Functional Programming
</title>
13 font-family: 'Press Start
2P', cursive;
17 background-color: #f98012;
18 background-image: url(
"img/tile.png");
19 background-repeat: repeat;
21 image-rendering: crisp-edges;
22 background-position-x: -
33px;
23 background-blend-mode: multiply;
32 letter-spacing: -
20px;
33 transform: rotate(
90deg) scale(
1,
1.5);
37 font-family: 'Press Start
2P', cursive;
38 text-shadow:
2px
2px
0 #
000;
43 text-shadow:
2px
2px
0 #
000;
49 text-shadow:
10px
10px
0 #
00000069;
55 justify-content: center;
59 box-shadow:
10px
10px
0 #
00000069;
62 background: #
6187a8e3;
68 justify-content: center;
75 text-shadow:
2px
2px
0 #
000;
84 image-rendering: optimizeSpeed; /* STOP SMOOTHING, GIVE ME SPEED */
85 image-rendering: -moz-crisp-edges; /* Firefox */
86 image-rendering: -o-crisp-edges; /* Opera */
87 image-rendering: -webkit-optimize-contrast; /* Chrome (and eventually Safari) */
88 image-rendering: pixelated; /* Chrome */
89 image-rendering: optimize-contrast; /* CSS3 Proposed */
90 -ms-interpolation-mode: nearest-neighbor; /* IE8+ */
93 #slide-
1 .shake-constant, .crazy, .span {
94 display: inline-block;
97 #slide-
1 .shake-opacity {
107 box-shadow:
10px
10px
0 #
00000069;
108 border:
2px solid black;
109 background-color: #
3f6382;
113 box-shadow:
10px
10px
0 #
00000069;
114 border:
2px solid black;
121 span[class^=
"code-friends"].on {
129 <div style=
"height: 20%; text-align: center;">
130 <img style=
"height: 100%; display: block; margin-left: auto; margin-right: auto; margin-bottom: 10px;" src=
"img/cloudguy.gif" />
131 <div id=
"cgquotes" style=
"width: 80%; margin: auto;">Welcome to the talk!
</div>
136 <div class=
"slide-title">=<< What's up with that Title?
>>=
</div>
138 <div style=
"justify-content: right;">
139 <img class=
"shake-constant shake" src=
"img/wide-eyed-crazy.png" style=
"width: 70%; margin-right: 10%;">
141 <div style=
"justify-content: left">
142 <div style=
"display: flex; align-items: center; width: 70%">
143 <div id=
"rant" class=
"textbox" style=
"display: block;height: auto; width:100%; margin-left:10%;">
144 <span class=
"crazy">It’s functions,
</span><span class=
"shake-constant shake-opacity">pure
</span><span class=
"crazy"> functions! Pure functions and their values, PURE FUNCTIONS FOREVER AND FOREVER AND FOREVER A HUNDRED YEARS
</span><span class=
"shake-constant shake-opacity">monad
</span><span class=
"crazy">... some... things... Me and
</span><span class=
"shake-constant shake-opacity">monads
</span><span class=
"crazy"> runnin' around and...
</span><span class=
"shake-constant shake-opacity">applicative functor
</span><span class=
"crazy"> time... a- all day long forever... All a - a hundred days
</span><span class=
"shake-constant shake-opacity">applicatives
</span><span class=
"crazy"> and
</span><span class=
"shake-constant shake-opacity">functors
</span><span class=
"crazy">! Forever a hundred times.... OVER and over
</span><span class=
"shake-constant shake-opacity">monad transformers
</span><span class=
"crazy">... adventures dot com... W W W dot at
</span><span class=
"shake-constant shake-opacity">lambda calculus
</span><span class=
"crazy"> and
</span><span class=
"shake-constant shake-opacity">category theory
</span><span class=
"crazy"> dot com w..w..w... function composition adventures... Ah- hundred years… Every minute
</span><span class=
"shake-constant shake-opacity">referential… transparency
</span><span class=
"crazy"> dot com.... w w w a hundred times...
</span><span class=
"shake-constant shake-opacity">composition
</span><span class=
"crazy"> dot com...
</span>
148 <div>Fig
1.1 What most people thing a typical functional programming advocate looks like
</div>
152 <div class=
"slide-title">=<< Obligatory Quote
>>=
</div>
157 <div class=
"slide-title">=<< Obligatory Quote
>>=
</div>
159 <div style=
"text-align:center; font-size:40px; text-shadow: 4px 4px #000;" >If you wish to build a ship, do not divide the men into teams and send them to the forest to cut wood. Instead, teach them to long for the vast and endless sea.
</div>
163 <div class=
"slide-title">=<< Promises
>>=
</div>
165 <div style=
"position: relative; text-align:center; font-size:40px; text-shadow: 4px 4px #000;" >
166 <div class=
"angereyWrap"><div class=
"angerey">>:(
</div></div>
167 <div class=
"angereyWrap"><div class=
"angerey">>:(
</div></div>
168 <div class=
"angereyWrap"><div class=
"angerey">>:(
</div></div>
169 <div class=
"angereyWrap"><div class=
"angerey">>:(
</div></div>
170 <div class=
"angereyWrap"><div class=
"angerey">>:(
</div></div>
171 <div class=
"angereyWrap"><div class=
"angerey">>:(
</div></div>
172 <div class=
"angereyWrap"><div class=
"angerey">>:(
</div></div>
173 <div class=
"angereyWrap"><div class=
"angerey">>:(
</div></div>
174 <div class=
"angereyWrap"><div class=
"angerey">>:(
</div></div>
175 <div class=
"angereyWrap"><div class=
"angerey">>:(
</div></div>
176 Promises
<span class=
"shake-slow shake-constant" style=
"display: inline-block; color: #f98012">do not
</span> make things asynchronous!
</div>
181 <div class=
"slide-title">=<< Promises
>>=
</div>
184 <pre><code class=
"javascript">Promise.resolve(
"We start here")
185 <span class=
"code-friends1" onmouseenter=
"activateFriends(1);" onmouseleave=
"deactivateFriends(1);" style=
"display: inline-block">.then
</span>(x =
> Promise.resolve(x +
" then get here"))
186 .then(x =
> Promise.resolve(x +
" and finally here!"))
</code></pre>
188 <pre><code class=
"haskell">Right(
"We start here")
189 <span class=
"code-friends1" onmouseenter=
"activateFriends(1);" onmouseleave=
"deactivateFriends(1);" style=
"display: inline-block">>>=
</span> (\x -
> Right (x ++
" then get here"))
190 >>= (\x -
> Right (x ++
" and finally here!"))
</code></pre>
195 var div, i, j, span, duration =
"";
198 div = document.querySelectorAll(
"#rant > span.crazy");
199 for (j =
0; j < div.length; j++) {
201 for (i =
0; i < div[j].innerText.length; i++) {
202 duration = Math.floor(Math.random() *
5) +
100
203 span +=
"<span class=\"letter shake-constant shake-little\" style=\"animation-duration: " + duration +
"ms\">";
204 span += div[j].innerText[i] ==
" " ?
" " : div[j].innerText[i];
207 crazyTexts.push(span);
210 opacities = document.querySelectorAll(
"#rant > span.shake-opacity");
211 for (k =
0; k < opacities.length; k++) {
213 opacities[k].style.animationDuration = shrek + 's';
214 opacyTexts.push(opacities[k].outerHTML);
218 for (l =
0; l< crazyTexts.length; l++) {
219 allText+=crazyTexts[l] +
" " + (opacyTexts[l] ? opacyTexts[l] :
"") +
" ";
222 document.getElementById('rant').innerHTML = allText;
226 var b = document.querySelectorAll('body')[
0];
227 setInterval(function(){
230 b.style.backgroundPosition = x + 'px ' + y + 'px';
233 urlParts = document.URL.split('#');
234 window.console.log(urlParts);
235 var currentSlide = urlParts.length
> 1 ? urlParts[
1] :
0;
236 document.getElementById('slide-' + currentSlide).style.display = 'block';
237 document.onkeydown = checkKey;
239 function checkKey(e) {
241 e = e || window.event;
242 if (e.keyCode == '
37') {
243 if (document.getElementById('slide-' + currentSlide)) {
244 document.getElementById('slide-' + currentSlide).style.display = 'none';
247 document.getElementById('slide-' + currentSlide).style.display = 'block';
249 else if (e.keyCode == '
39') {
250 if (document.getElementById('slide-' + currentSlide)) {
251 document.getElementById('slide-' + currentSlide).style.display = 'none';
254 document.getElementById('slide-' + currentSlide).style.display = 'block';
259 function activateFriends(n) {
260 f = document.querySelectorAll('.code-friends' + n);
261 f[
0].classList.add(
"shake-constant");
262 f[
0].classList.add(
"shake-slow");
263 f[
0].classList.add(
"on");
264 f[
1].classList.add(
"shake-constant");
265 f[
1].classList.add(
"shake-slow");
266 f[
1].classList.add(
"on");
269 function deactivateFriends(n) {
270 f = document.querySelectorAll('.code-friends' + n);
271 f[
0].classList.remove(
"shake-constant");
272 f[
0].classList.remove(
"shake-slow");
273 f[
0].classList.remove(
"on");
274 f[
1].classList.remove(
"shake-constant");
275 f[
1].classList.remove(
"shake-slow");
276 f[
1].classList.remove(
"on");
280 "Welcome to the talk!",
281 "I hope we'll have fun exploring functional programming together!",
282 "But while we wait let's share interesting facts and anectodes :)",
283 "If you can be disgruntled, can you also be gruntled?",
284 "0.9 recurring is exactly equal to one if you think about it.",
285 "In English, the word \"ghoti\" can be pronounced as \"fish\".",
286 "Your credit card details are somewhere in Pi.",
287 "It takes 366 people to make sure two of them share a birthday, but only 23 people to ensure a 50% chance.",
288 "1729 is the best number (I checked them all).",
289 "The secret to strengh is to eat only a banana for breakfast",
290 "All of Back to the Future happened in the past.",
291 "Everything is in the future."
294 cgq = document.getElementById(
"cgquotes");
295 numQuotes = cloudGuyQuotes.length;
297 setInterval(function(){
298 cgq.innerText = cloudGuyQuotes[currentQuote];
299 currentQuote = (currentQuote +
1) % numQuotes;
302 angeries = document.querySelectorAll(
".angereyWrap");
304 shakes = [
"shake",
"shake-hard",
"shake-slow",
"shake-little",
"shake-horizontal",
"shake-vertical",
"shake-rotate",
"shake-opacity",
"shake-crazy",
"shake-chunk"];
305 for (a =
0; a < angeries.length; a++) {
306 randomness = (Math.round(Math.random() *
10) +
1) * -
10;
307 angeries[a].style.top = ((a
> 4) ? (-
180-randomness) : (
180 + randomness)) +
"%" ;
308 thing = ((Math.floor(Math.random() *
10) +
1) *
9) +
"%";
310 while (usedPositions.includes(thing)) {
311 thing = ((Math.floor(Math.random() *
10) +
1) *
9) +
"%";
314 angeries[a].style.left = thing;
315 angeries[a].classList.add(
"shake-constant");
316 angeries[a].classList.add(shakes[Math.floor(Math.random()*shakes.length)]);
317 usedPositions.push(thing);