|
1 | 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
|
2 |
| - "http://www.w3.org/TR/html4/strict.dtd"> |
| 2 | + "https://www.w3.org/TR/html4/strict.dtd"> |
3 | 3 | <html>
|
4 | 4 | <head>
|
5 | 5 | <title>For a Few Monads More - Learn You a Haskell for Great Good!</title>
|
|
33 | 33 | </div>
|
34 | 34 | <h1>For a Few Monads More</h1>
|
35 | 35 |
|
36 |
| -<img src="http://s3.amazonaws.com/lyah/clint.png" alt="there are two kinds of people in the world, my friend. those who learn them a haskell and those who have the job of coding java" class="right" width="189" height="400"> |
| 36 | +<img src="https://s3.amazonaws.com/lyah/clint.png" alt="there are two kinds of people in the world, my friend. those who learn them a haskell and those who have the job of coding java" class="right" width="189" height="400"> |
37 | 37 |
|
38 | 38 | <p>
|
39 | 39 | We've seen how monads can be used to take values with contexts and apply them to
|
@@ -123,7 +123,7 @@ <h2>Writer? I hardly know her!</h2>
|
123 | 123 | (True,"Compared gang size to 9.")
|
124 | 124 | </pre>
|
125 | 125 |
|
126 |
| -<img src="http://s3.amazonaws.com/lyah/tuco.png" alt="when you have to poop, poop, don't talk" class="left" |
| 126 | +<img src="https://s3.amazonaws.com/lyah/tuco.png" alt="when you have to poop, poop, don't talk" class="left" |
127 | 127 | width="196" height="280">
|
128 | 128 |
|
129 | 129 | <p>
|
@@ -394,7 +394,7 @@ <h3>The Writer type</h3>
|
394 | 394 | </pre>
|
395 | 395 |
|
396 | 396 |
|
397 |
| -<img src="http://s3.amazonaws.com/lyah/angeleyes.png" alt="when you have to poop, poop, don't talk" class="right" width="383" height="248"> |
| 397 | +<img src="https://s3.amazonaws.com/lyah/angeleyes.png" alt="when you have to poop, poop, don't talk" class="right" width="383" height="248"> |
398 | 398 | <p>
|
399 | 399 | First off, let's examine <span class="fixed">>>=</span>. Its
|
400 | 400 | implementation is essentially the same as <span class="fixed">applyLog</span>,
|
@@ -756,7 +756,7 @@ <h3>Inefficient list construction</h3>
|
756 | 756 |
|
757 | 757 | <h3>Difference lists</h3>
|
758 | 758 |
|
759 |
| -<img src="http://s3.amazonaws.com/lyah/cactus.png" alt="cactuses" class="left" width="147" height="300"> |
| 759 | +<img src="https://s3.amazonaws.com/lyah/cactus.png" alt="cactuses" class="left" width="147" height="300"> |
760 | 760 |
|
761 | 761 | <p>
|
762 | 762 | Because lists can sometimes be inefficient when repeatedly appended in this
|
@@ -975,7 +975,7 @@ <h3>Comparing Performance</h3>
|
975 | 975 | <a name="reader"></a>
|
976 | 976 | <h2>Reader? Ugh, not this joke again.</h2>
|
977 | 977 |
|
978 |
| -<img src="http://s3.amazonaws.com/lyah/revolver.png" alt="bang youre dead" class="left" width="280" |
| 978 | +<img src="https://s3.amazonaws.com/lyah/revolver.png" alt="bang youre dead" class="left" width="280" |
979 | 979 | height="106">
|
980 | 980 |
|
981 | 981 | <p>
|
@@ -1136,7 +1136,7 @@ <h2>Reader? Ugh, not this joke again.</h2>
|
1136 | 1136 |
|
1137 | 1137 | <a name="state"></a>
|
1138 | 1138 | <h2>Tasteful stateful computations</h2>
|
1139 |
| -<img src="http://s3.amazonaws.com/lyah/texas.png" alt="don't jest with texas" class="left" width="244" |
| 1139 | +<img src="https://s3.amazonaws.com/lyah/texas.png" alt="don't jest with texas" class="left" width="244" |
1140 | 1140 | height="230">
|
1141 | 1141 |
|
1142 | 1142 | <p>
|
@@ -1367,7 +1367,7 @@ <h3>The State monad</h3>
|
1367 | 1367 | a certain value as the result and keeps the state unchanged.
|
1368 | 1368 | </p>
|
1369 | 1369 |
|
1370 |
| -<img src="http://s3.amazonaws.com/lyah/badge.png" alt="im a cop" class="right" width="182" height="160"> |
| 1370 | +<img src="https://s3.amazonaws.com/lyah/badge.png" alt="im a cop" class="right" width="182" height="160"> |
1371 | 1371 |
|
1372 | 1372 | <p>
|
1373 | 1373 | What about <span class="fixed">>>=</span>? Well, the result of feeding a
|
@@ -1822,7 +1822,7 @@ <h2>Some useful monadic functions</h2>
|
1822 | 1822 |
|
1823 | 1823 | <h3>liftM and friends</h3>
|
1824 | 1824 |
|
1825 |
| -<img src="http://s3.amazonaws.com/lyah/wolf.png" alt="im a cop too" class="right" width="394" height="222"> |
| 1825 | +<img src="https://s3.amazonaws.com/lyah/wolf.png" alt="im a cop too" class="right" width="394" height="222"> |
1826 | 1826 |
|
1827 | 1827 | <p>
|
1828 | 1828 | When we started our journey to the top of Monad Mountain, we first looked
|
@@ -2185,7 +2185,7 @@ <h3>The join function</h3>
|
2185 | 2185 | m
|
2186 | 2186 | </pre>
|
2187 | 2187 |
|
2188 |
| -<img src="http://s3.amazonaws.com/lyah/tipi.png" alt="im a cop too as well also" class="right" width="253" |
| 2188 | +<img src="https://s3.amazonaws.com/lyah/tipi.png" alt="im a cop too as well also" class="right" width="253" |
2189 | 2189 | height="379">
|
2190 | 2190 |
|
2191 | 2191 | <p>
|
@@ -2470,7 +2470,7 @@ <h3>foldM</h3>
|
2470 | 2470 |
|
2471 | 2471 | <h3>Making a safe RPN calculator</h3>
|
2472 | 2472 |
|
2473 |
| -<img src="http://s3.amazonaws.com/lyah/miner.png" alt="i've found yellow!" class="left" width="280" |
| 2473 | +<img src="https://s3.amazonaws.com/lyah/miner.png" alt="i've found yellow!" class="left" width="280" |
2474 | 2474 | height="396">
|
2475 | 2475 |
|
2476 | 2476 | <p>
|
@@ -2774,7 +2774,7 @@ <h3>Composing monadic functions</h3>
|
2774 | 2774 |
|
2775 | 2775 | <a name="making-monads"></a>
|
2776 | 2776 | <h2>Making monads</h2>
|
2777 |
| -<img src="http://s3.amazonaws.com/lyah/spearhead.png" alt="kewl" class="center" width="780" height="244"> |
| 2777 | +<img src="https://s3.amazonaws.com/lyah/spearhead.png" alt="kewl" class="center" width="780" height="244"> |
2778 | 2778 |
|
2779 | 2779 | <p>
|
2780 | 2780 | In this section, we're going to look at an example of how a type gets made,
|
@@ -2929,7 +2929,7 @@ <h2>Making monads</h2>
|
2929 | 2929 | models this scenario:
|
2930 | 2930 | </p>
|
2931 | 2931 |
|
2932 |
| -<img src="http://s3.amazonaws.com/lyah/prob.png" alt="probs" class="left" width="456" height="142"> |
| 2932 | +<img src="https://s3.amazonaws.com/lyah/prob.png" alt="probs" class="left" width="456" height="142"> |
2933 | 2933 |
|
2934 | 2934 | <p>
|
2935 | 2935 | What are the chances for each of these letters to occur? If we were to draw this
|
@@ -2992,7 +2992,7 @@ <h2>Making monads</h2>
|
2992 | 2992 | fail _ = Prob []
|
2993 | 2993 | </pre>
|
2994 | 2994 |
|
2995 |
| -<img src="http://s3.amazonaws.com/lyah/ride.png" alt="ride em cowboy" class="right" width="177" height="406"> |
| 2995 | +<img src="https://s3.amazonaws.com/lyah/ride.png" alt="ride em cowboy" class="right" width="177" height="406"> |
2996 | 2996 |
|
2997 | 2997 | <p>
|
2998 | 2998 | Because we already did all the hard work, the instance is very simple. We also
|
|
0 commit comments