|
9 | 9 | @import url('reset.css'); |
10 | 10 | @import url('style.css'); |
11 | 11 | </style> |
12 | | -<link rel="shortcut icon" href="favicon.png" type="image/png"> |
| 12 | +<link rel="shortcut icon" href="assets/images/favicon.png" type="image/png"> |
13 | 13 | <link rel="prev" href="functors-applicative-functors-and-monoids.html"> |
14 | 14 | <link rel="next" href="for-a-few-monads-more.html"> |
15 | 15 | <link type="text/css" rel="stylesheet" href="sh/Styles/SyntaxHighlighter.css"> |
@@ -47,7 +47,7 @@ <h1>A Fistful of Monads</h1> |
47 | 47 | applicative functors are only beefed up functors. |
48 | 48 | </p> |
49 | 49 |
|
50 | | -<img src="https://s3.amazonaws.com/lyah/smugpig.png" alt="more cool than u" class="right" width="307" height="186"> |
| 50 | +<img src="assets/images/a-fistful-of-monads/smugpig.png" alt="more cool than u" class="right" width="307" height="186"> |
51 | 51 |
|
52 | 52 | <p> |
53 | 53 | When we started off with functors, we saw that it's possible to map functions |
@@ -168,7 +168,7 @@ <h1>A Fistful of Monads</h1> |
168 | 168 | <a name="getting-our-feet-wet-with-maybe"></a> |
169 | 169 | <h2>Getting our feet wet with Maybe</h2> |
170 | 170 |
|
171 | | -<img src="https://s3.amazonaws.com/lyah/buddha.png" alt="monads, grasshoppa" class="left" width="302" height="387"> |
| 171 | +<img src="assets/images/a-fistful-of-monads/buddha.png" alt="monads, grasshoppa" class="left" width="302" height="387"> |
172 | 172 |
|
173 | 173 | <p> |
174 | 174 | Now that we have a vague idea of what monads are about, let's see if we can make |
@@ -393,7 +393,7 @@ <h2>The Monad type class</h2> |
393 | 393 | fail msg = error msg |
394 | 394 | </pre> |
395 | 395 |
|
396 | | -<img src="https://s3.amazonaws.com/lyah/kid.png" alt="this is you on monads" class="right" width="363" height="451"> |
| 396 | +<img src="assets/images/a-fistful-of-monads/kid.png" alt="this is you on monads" class="right" width="363" height="451"> |
397 | 397 | <p> |
398 | 398 | Let's start with the first line. It says <span class="fixed">class Monad m where</span>. |
399 | 399 | But wait, didn't we say that monads are just beefed up applicative functors? Shouldn't |
@@ -429,7 +429,7 @@ <h2>The Monad type class</h2> |
429 | 429 | context. |
430 | 430 | </div> |
431 | 431 |
|
432 | | -<img src="https://s3.amazonaws.com/lyah/tur2.png" alt="hmmm yaes" class="left" width="169" height="145"> |
| 432 | +<img src="assets/images/a-fistful-of-monads/tur2.png" alt="hmmm yaes" class="left" width="169" height="145"> |
433 | 433 |
|
434 | 434 | <p> |
435 | 435 | The next function is <span class="fixed">>>=</span>, or bind. It's like |
@@ -515,7 +515,7 @@ <h2>The Monad type class</h2> |
515 | 515 | <a name="walk-the-line"></a> |
516 | 516 | <h2>Walk the line</h2> |
517 | 517 |
|
518 | | -<img src="https://s3.amazonaws.com/lyah/pierre.png" alt="pierre" class="left" width="374" height="405"> |
| 518 | +<img src="assets/images/a-fistful-of-monads/pierre.png" alt="pierre" class="left" width="374" height="405"> |
519 | 519 |
|
520 | 520 | <p> |
521 | 521 | Now that we know how to feed a <span class="fixed">Maybe a</span> value to a |
@@ -809,7 +809,7 @@ <h2>Walk the line</h2> |
809 | 809 | Nothing |
810 | 810 | </pre> |
811 | 811 |
|
812 | | -<img src="https://s3.amazonaws.com/lyah/banana.png" alt="iama banana" class="right" width="262" height="130"> |
| 812 | +<img src="assets/images/a-fistful-of-monads/banana.png" alt="iama banana" class="right" width="262" height="130"> |
813 | 813 |
|
814 | 814 | <p> |
815 | 815 | Awesome. The final result represents failure, which is what we expected. Let's |
@@ -940,7 +940,7 @@ <h2>Walk the line</h2> |
940 | 940 | Just pole3 -> landLeft 1 pole3 |
941 | 941 | </pre> |
942 | 942 |
|
943 | | -<img src="https://s3.amazonaws.com/lyah/centaur.png" alt="john joe glanton" class="right" width="297" height="331"> |
| 943 | +<img src="assets/images/a-fistful-of-monads/centaur.png" alt="john joe glanton" class="right" width="297" height="331"> |
944 | 944 |
|
945 | 945 | <p> |
946 | 946 | We land a bird on the left and then we examine the possibility of failure and |
@@ -1077,7 +1077,7 @@ <h2>do notation</h2> |
1077 | 1077 | Just (show x ++ y) |
1078 | 1078 | </pre> |
1079 | 1079 |
|
1080 | | -<img src="https://s3.amazonaws.com/lyah/owld.png" alt="90s owl" class="right" width="269" height="348"> |
| 1080 | +<img src="assets/images/a-fistful-of-monads/owld.png" alt="90s owl" class="right" width="269" height="348"> |
1081 | 1081 |
|
1082 | 1082 | <p> |
1083 | 1083 | It would seem as though we've gained the ability to temporarily extract things |
@@ -1329,7 +1329,7 @@ <h2>do notation</h2> |
1329 | 1329 |
|
1330 | 1330 | <a name="the-list-monad"></a> |
1331 | 1331 | <h2>The list monad</h2> |
1332 | | -<img src="https://s3.amazonaws.com/lyah/deadcat.png" alt="dead cat" class="left" width="235" height="230"> |
| 1332 | +<img src="assets/images/a-fistful-of-monads/deadcat.png" alt="dead cat" class="left" width="235" height="230"> |
1333 | 1333 | <p> |
1334 | 1334 | So far, we've seen how <span class="fixed">Maybe</span> values can be viewed as |
1335 | 1335 | values with a failure context and how we can incorporate failure handling into |
@@ -1465,7 +1465,7 @@ <h2>The list monad</h2> |
1465 | 1465 | [(1,'a'),(1,'b'),(2,'a'),(2,'b')] |
1466 | 1466 | </pre> |
1467 | 1467 |
|
1468 | | -<img src="https://s3.amazonaws.com/lyah/concatmap.png" alt="concatmap" class="left" width="399" height="340"> |
| 1468 | +<img src="assets/images/a-fistful-of-monads/concatmap.png" alt="concatmap" class="left" width="399" height="340"> |
1469 | 1469 |
|
1470 | 1470 | <p> |
1471 | 1471 | The list <span class="fixed">[1,2]</span> gets bound to <span |
@@ -1692,7 +1692,7 @@ <h3>A knight's quest</h3> |
1692 | 1692 | the row. |
1693 | 1693 | </p> |
1694 | 1694 |
|
1695 | | -<img src="https://s3.amazonaws.com/lyah/chess.png" alt="hee haw im a horse" class="center" width="760" height="447"> |
| 1695 | +<img src="assets/images/a-fistful-of-monads/chess.png" alt="hee haw im a horse" class="center" width="760" height="447"> |
1696 | 1696 |
|
1697 | 1697 | <p> |
1698 | 1698 | Let's make a type synonym for the knight's current position on the chess board: |
@@ -1842,7 +1842,7 @@ <h3>A knight's quest</h3> |
1842 | 1842 | <a name="monad-laws"></a> |
1843 | 1843 | <h2>Monad laws</h2> |
1844 | 1844 |
|
1845 | | -<img src="https://s3.amazonaws.com/lyah/judgedog.png" alt="the court finds you guilty of peeing all over |
| 1845 | +<img src="assets/images/a-fistful-of-monads/judgedog.png" alt="the court finds you guilty of peeing all over |
1846 | 1846 | everything" class="right" width="343" height="170"> |
1847 | 1847 |
|
1848 | 1848 | <p> |
|
0 commit comments