jackkelly.name.rss.xml - sfeed_tests - sfeed tests and RSS and Atom files | |
git clone git://git.codemadness.org/sfeed_tests | |
Log | |
Files | |
Refs | |
README | |
LICENSE | |
--- | |
jackkelly.name.rss.xml (150211B) | |
--- | |
1 <?xml version="1.0" encoding="utf-8"?> | |
2 <rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" | |
3 xmlns:dc="http://purl.org/dc/elements/1.1/"> | |
4 <channel> | |
5 <title>Blog | jackkelly.name</title> | |
6 <link>http://jackkelly.name</link> | |
7 <description><![CDATA[Latest posts on jackkelly.name]]></descrip… | |
8 <atom:link href="http://jackkelly.name/blog/rss.xml" rel="self" | |
9 type="application/rss+xml" /> | |
10 <lastBuildDate>Fri, 09 Jul 2021 13:00:00 UT</lastBuildDate> | |
11 <item> | |
12 <title>Free Software's Relevance in 2021</title> | |
13 <link>http://jackkelly.name/blog/archives/2021/07/09/free_softwares_… | |
14 <description><![CDATA[<p>2020 was a bad year at the end of a bad dec… | |
15 <!--more--> | |
16 <h2 id="why-software-freedom-matters">Why Software Freedom Matters</h2> | |
17 <p>Over the past eighteen months, there have been incredible restriction… | |
18 <p>In Australia, we are required by law to report our personal movements… | |
19 <p>We live our lives at the mercy of software, and have been doing so we… | |
20 <ul> | |
21 <li><p>Inflexible automated systems make human compassion and discretion… | |
22 <li><p>The <a href="https://en.wikipedia.org/wiki/Robodebt_scheme">“Ro… | |
23 <li><p>“Smart home” devices in general. All software is haunted; a h… | |
24 </ul> | |
25 <p>Being able to inspect, modify and run software on your own terms is v… | |
26 <ul> | |
27 <li>The freedom to run the program for any purpose;</li> | |
28 <li>The freedom to study the program, and to change it;</li> | |
29 <li>The freedom to redistribute copies; and</li> | |
30 <li>The freedom to distribute your modified copies.</li> | |
31 </ul> | |
32 <h2 id="the-four-freedoms-are-not-enough">The Four Freedoms are not Enou… | |
33 <p>These days, the FSF’s four freedoms are not enough to ensure softwa… | |
34 <ul> | |
35 <li><p>Having the ability to see/change/build the source code to a progr… | |
36 <ul> | |
37 <li><p>The large body of BSD/MIT/X11-licenced software allows proprietar… | |
38 <ul> | |
39 <li>Example: Windows certification on x86/amd64 used to require the comp… | |
40 </ul></li> | |
41 <li><p>Software running on a server or “in the cloud” is never “di… | |
42 </ul></li> | |
43 <li><p>The rise of software powered by machine learning models means tha… | |
44 </ul> | |
45 <h2 id="the-market-will-not-save-you">The Market will not Save You</h2> | |
46 <p>For years, privacy advocates have been saying <a href="https://duckdu… | |
47 <ul> | |
48 <li><p>Windows gets a special dishonourable mention:</p> | |
49 <ul> | |
50 <li><p>Windows 10 includes advertising all over the OS, even down to <a … | |
51 <li><p>Windows <a href="https://www.windowslatest.com/2020/11/15/windows… | |
52 <ul> | |
53 <li>Seen <a href="https://www.windowslatest.com/2021/05/31/windows-10-is… | |
54 </ul></li> | |
55 <li><p>Windows has a bad habit of restarting to install “updates”, w… | |
56 </ul></li> | |
57 <li><p>Windows isn’t the only offender of this type. Google recently i… | |
58 <li><p>Even <a href="https://news.ycombinator.com/item?id=24502768">mous… | |
59 <li><p>Have you tried to buy a non-“smart” TV recently? You pretty m… | |
60 </ul> | |
61 <h2 id="copyleft-software-is-not-attractive-enough">Copyleft Software is… | |
62 <p>The FSF’s proposed solution is to release software under <a href="h… | |
63 <h2 id="suggestions">Suggestions</h2> | |
64 <p>I’d love to set out a clear and simple plan to liberate the world t… | |
65 <h3 id="one-make-it-easier-to-contribute-to-copyleft-projects">One: Make… | |
66 <p>The GCC Project recently relaxed its contributing requirements from �… | |
67 <p>If you run a project and proceed on this path, I think it’s most fu… | |
68 <h3 id="two-copyleft-unique-software">Two: Copyleft Unique Software</h3> | |
69 <p>If you publish a copyleft library in a crowded domain, people can fli… | |
70 <p>Famous example in the other direction: <a href="https://www.xiph.org/… | |
71 <h3 id="three-develop-for-emerging-languages">Three: Develop for Emergin… | |
72 <p>A more extreme version of point two: because there are relatively few… | |
73 <p>I think that if copyleft software wants to carve a niche for itself i… | |
74 <ul> | |
75 <li><p>Emerging languages often aim to give developers more power, which… | |
76 <ul> | |
77 <li>Developer tooling is another potential target area, as it’s <a hre… | |
78 </ul></li> | |
79 <li><p>There are often fewer developers in an emerging language overall,… | |
80 <li><p>People working on a new niche may be happy just to “work on the… | |
81 <li><p>There are often large gaps in the libraries available for emergin… | |
82 </ul> | |
83 <p>It could be interesting to see what happens to an emerging language w… | |
84 <h3 id="four-build-ecosystems">Four: Build Ecosystems</h3> | |
85 <p>Generalising point three: a single copyleft library is easily worked … | |
86 <h3 id="five-use-stronger-licenses-when-strategically-possible">Five: Us… | |
87 <p>Especially on unique software (point two), use licenses that provide … | |
88 <h2 id="conclusion">Conclusion</h2> | |
89 <p>I think that free software is vitally important to public society, an… | |
90 <pubDate>Fri, 09 Jul 2021 13:00:00 UT</pubDate> | |
91 <guid>http://jackkelly.name/blog/archives/2021/07/09/free_softwares_… | |
92 <dc:creator>Jack Kelly</dc:creator> | |
93 </item> | |
94 <item> | |
95 <title>Town of ZZT - Remixed</title> | |
96 <link>http://jackkelly.name/blog/archives/2021/01/05/town_of_zzt_-_r… | |
97 <description><![CDATA[<p><strong>TL;DR:</strong> ZZT is now 30, ther… | |
98 <p>Thirty years ago, on the 15th of January 1991, Tim Sweeney released h… | |
99 <p><img src="/blog/images/zzt/zzt.png" alt="Original TOWN.ZZT Title Scre… | |
100 <!--more--> | |
101 <p>Despite being technially dated even when it came out (<a href="http:/… | |
102 <p>But back to ZZT. ZZT came with an editor, and the game’s simplicity… | |
103 <p>During 2020, the Discord of ZZT community decided to remix the first … | |
104 <p><a href="https://museumofzzt.com/file/t/TOWNRMIX.zip"><img src="/blog… | |
105 <p>This thing is seriously impressive. Most boards had a substantial vis… | |
106 <p><a href="https://twitter.com/worldsofzzt/status/1345202964667875329">… | |
107 <p>The community was a delight to work with, which helped the project fe… | |
108 <p>The museum has a ZIP file explorer and can run ZZT in your browser, s… | |
109 <pubDate>Tue, 05 Jan 2021 13:00:00 UT</pubDate> | |
110 <guid>http://jackkelly.name/blog/archives/2021/01/05/town_of_zzt_-_r… | |
111 <dc:creator>Jack Kelly</dc:creator> | |
112 </item> | |
113 <item> | |
114 <title>Vaccine Deployment</title> | |
115 <link>http://jackkelly.name/blog/archives/2021/01/04/vaccine_deploym… | |
116 <description><![CDATA[<p><strong>TL;DR:</strong> Despite earlier res… | |
117 <p>(Note: Twitter links have screenshots next to them, as it’s notorio… | |
118 <p>Emergency approvals for the major vaccine candidates (Pfizer/BioNTech… | |
119 <!--more--> | |
120 <ul> | |
121 <li><p><a href="https://web.archive.org/web/20201112033233/https://www.w… | |
122 <blockquote> | |
123 <p>Herd immunity is the indirect protection from an infectious disease t… | |
124 </blockquote></li> | |
125 <li><p><a href="https://web.archive.org/web/20201114155111/https://www.w… | |
126 <blockquote> | |
127 <p>‘Herd immunity’, also known as ‘population immunity’, is a co… | |
128 </blockquote></li> | |
129 <li><p><a href="https://web.archive.org/web/20201231221345/https://www.w… | |
130 <blockquote> | |
131 <p>‘Herd immunity’, also known as ‘population immunity’, is the … | |
132 </blockquote></li> | |
133 </ul> | |
134 <p>The 2020-11-24 definition attempts to <a href="/blog/archives/2020/06… | |
135 <p>What else is changing? Well, we have <a href="https://www.nytimes.com… | |
136 <blockquote> | |
137 <p>In a telephone interview the next day, Dr. Fauci acknowledged that h… | |
138 <p>[…]</p> | |
139 <p>Dr. Fauci said that weeks ago, he had hesitated to publicly raise hi… | |
140 <p>[…]</p> | |
141 <p>“When polls said only about half of all Americans would take a vacc… | |
142 </blockquote> | |
143 <p>It is despicable to gripe that people aren’t “trusting the scienc… | |
144 <h2 id="hows-the-rollout-going">How’s the Rollout Going?</h2> | |
145 <p>We now need more people than ever to get jabbed, and the faster the b… | |
146 <p>How about the rest of the world? Here’s a <a href="https://www.bloo… | |
147 <ul> | |
148 <li>Canada: vaccinators took several days off during holidays.</li> | |
149 <li>UK: a retired GP was unable to volunteer as a vaccinator, because sh… | |
150 <li>US: some doses are being given out to the general public, because th… | |
151 </ul> | |
152 <h2 id="will-people-take-a-vaccine">Will People take a Vaccine?</h2> | |
153 <p>It doesn’t matter how bad the rollout machinery is if nobody is tak… | |
154 <ul> | |
155 <li><a href="https://twitter.com/HHH_Report/status/1340098612487983105">… | |
156 <li><a href="https://twitter.com/conorduffy_7/status/1345175306202722309… | |
157 </ul> | |
158 <p>Would I take a vaccine? I’ve been hesitant about the SARS-CoV-2 vac… | |
159 <p>So why have I changed my mind? I’m concerned by these “<a href="h… | |
160 <details> | |
161 <summary> | |
162 Musings of an anonymous, pissed-off virologist | |
163 </summary> | |
164 <blockquote> | |
165 <p> | |
166 As viruses go, SARS-CoV-2, is quite easy to neutralize with antibodies a… | |
167 </p> | |
168 <p> | |
169 However, if I had a nefarious nature and wanted to ensure that the new S… | |
170 </p> | |
171 <p> | |
172 First, we’d want to maximize the viral population size and diversity. … | |
173 </p> | |
174 <ol> | |
175 <li> | |
176 Delay the rollout of testing, so that the virus could spread undetected,… | |
177 </li> | |
178 <li> | |
179 Implement partial and patchy restrictions on movement and social interac… | |
180 </li> | |
181 <li> | |
182 Keep schools open, claiming that children don’t frequently transmit SA… | |
183 </li> | |
184 <li> | |
185 Start a rumor-mill, making full use of social media and other outlets, w… | |
186 </li> | |
187 </ol> | |
188 <p> | |
189 Second, during or after the establishment of large and diverse viral pop… | |
190 </p> | |
191 <ol start="5"> | |
192 <li> | |
193 Treat tens of thousands of people with uncharacterized convalescent plas… | |
194 </li> | |
195 <li> | |
196 Finally, and here’s the kicker: having developed a remarkable two-dose… | |
197 </li> | |
198 </ol> | |
199 </blockquote> | |
200 </details> | |
201 <p>The world’s pathologically (heh) bad response creates a rich enviro… | |
202 <ol type="1"> | |
203 <li><p>The risk trade-off is much higher because there’s a lot more vi… | |
204 <li><p>Faster vaccination rollout limits the amount of time the virus ha… | |
205 <li><p>The current degree of lockdown is extremely unpleasant, complianc… | |
206 </ol> | |
207 <p>However, I have seen a couple of things that make me a bit cautious. … | |
208 <ol type="1"> | |
209 <li><p>Obviously and badly stage-managed vaccinations. I can’t find th… | |
210 <li><p>Four participants in the vaccine group of one of the Pfizer trial… | |
211 </ol> | |
212 <p>But in Australia, we’re not expecting to see rollout until March or… | |
213 <ol type="1"> | |
214 <li><p>We don’t have widespread community transmission because our hot… | |
215 <p><strong>Note:</strong> This is not a one-sided trade-off. As demonstr… | |
216 <li><p>We probably won’t start seeing the vaccine rollout for a couple… | |
217 <li><p>Australians are more likely to be vaccinated using the Oxford/Ast… | |
218 <li><p><a href="https://www.9news.com.au/national/coronavirus-vaccine-au… | |
219 <blockquote> | |
220 <p>“We will be making the vaccine free and voluntary,” Mr Morrison s… | |
221 </blockquote> | |
222 <p>After a year of noble lies and deceitful manipulation of the public, … | |
223 </ol> | |
224 <p>We are not at the end, we haven’t yet seen the light at the end of … | |
225 <pubDate>Mon, 04 Jan 2021 13:00:00 UT</pubDate> | |
226 <guid>http://jackkelly.name/blog/archives/2021/01/04/vaccine_deploym… | |
227 <dc:creator>Jack Kelly</dc:creator> | |
228 </item> | |
229 <item> | |
230 <title>Profunctor Decoders? Optical Decoders?</title> | |
231 <link>http://jackkelly.name/blog/archives/2020/11/03/profunctor_deco… | |
232 <description><![CDATA[<p>I’ve been wrangling with an interesting d… | |
233 <!--more--> | |
234 <h2 id="the-problem">The Problem</h2> | |
235 <p><a href="https://hackage.haskell.org/package/amazonka-dynamodb"><code… | |
236 <p>When storing or retrieving data (e.g., with the <a href="https://hack… | |
237 <ol> | |
238 <li> | |
239 It needs to be composable. There should be little difference between (de… | |
240 </li> | |
241 <li> | |
242 <p>(De)serialising should be as close to bidirectional as possible, but … | |
243 <details> | |
244 <summary> | |
245 Aside: Single-Table Design in DynamoDB | |
246 </summary> | |
247 <p>Alex DeBrie has a great article on <a href="https://www.alexdebrie.co… | |
248 <blockquote> | |
249 In fact, a well-optimized single-table DynamoDB layout looks more like m… | |
250 </blockquote> | |
251 Rick Houlihan has also given some excellent talks about DynamoDB: <a hre… | |
252 </details> | |
253 </li> | |
254 <li> | |
255 It should be symmetric. Where it makes sense, encoding and decoding shou… | |
256 </li> | |
257 <li> | |
258 It should be ergonomic. This is somewhat subjective, but important. Bad … | |
259 </li> | |
260 <li> | |
261 It should have good error reporting. It’s unacceptable to return <code… | |
262 </li> | |
263 </ol> | |
264 <h2 id="non-solution-tofrom-classes">Non-Solution: <code>To</code>/<code… | |
265 <p><a href="https://hackage.haskell.org/package/aeson"><code>aeson</code… | |
266 <div class="sourceCode" id="cb1"><pre class="sourceCode haskell"><code c… | |
267 <span id="cb1-2"><a href="#cb1-2" aria-hidden="true"></a></span> | |
268 <span id="cb1-3"><a href="#cb1-3" aria-hidden="true"></a><span class="kw… | |
269 <span id="cb1-4"><a href="#cb1-4" aria-hidden="true"></a><span class="ot… | |
270 <span id="cb1-5"><a href="#cb1-5" aria-hidden="true"></a></span> | |
271 <span id="cb1-6"><a href="#cb1-6" aria-hidden="true"></a><span class="kw… | |
272 <span id="cb1-7"><a href="#cb1-7" aria-hidden="true"></a><span class="ot… | |
273 <span id="cb1-8"><a href="#cb1-8" aria-hidden="true"></a></span> | |
274 <span id="cb1-9"><a href="#cb1-9" aria-hidden="true"></a><span class="kw… | |
275 <span id="cb1-10"><a href="#cb1-10" aria-hidden="true"></a><span class="… | |
276 <span id="cb1-11"><a href="#cb1-11" aria-hidden="true"></a></span> | |
277 <span id="cb1-12"><a href="#cb1-12" aria-hidden="true"></a><span class="… | |
278 <span id="cb1-13"><a href="#cb1-13" aria-hidden="true"></a><span class="… | |
279 <p>This is not acceptable for several reasons:</p> | |
280 <ul> | |
281 <li><p>Type classes for serialisation become awkward across package boun… | |
282 <li><p>Type-class-based serialisation libraries sometimes provide instan… | |
283 <li><p>There’s no symmetry between encoders and decoders. Decoders may… | |
284 </ul> | |
285 <h2 id="partial-solution-profunctorarrow-coders">Partial Solution: Profu… | |
286 <p>We want to be able to abstract our inputs over <code>AttributeValue</… | |
287 <div class="sourceCode" id="cb2"><pre class="sourceCode haskell"><code c… | |
288 <span id="cb2-2"><a href="#cb2-2" aria-hidden="true"></a><span class="ot… | |
289 <span id="cb2-3"><a href="#cb2-3" aria-hidden="true"></a><span class="ot… | |
290 <span id="cb2-4"><a href="#cb2-4" aria-hidden="true"></a></span> | |
291 <span id="cb2-5"><a href="#cb2-5" aria-hidden="true"></a><span class="kw… | |
292 <span id="cb2-6"><a href="#cb2-6" aria-hidden="true"></a> <span class="… | |
293 <span id="cb2-7"><a href="#cb2-7" aria-hidden="true"></a> <span class="… | |
294 <span id="cb2-8"><a href="#cb2-8" aria-hidden="true"></a> <span class="… | |
295 <span id="cb2-9"><a href="#cb2-9" aria-hidden="true"></a></span> | |
296 <span id="cb2-10"><a href="#cb2-10" aria-hidden="true"></a><span class="… | |
297 <span id="cb2-11"><a href="#cb2-11" aria-hidden="true"></a>hoistCoder nt… | |
298 <p>(<code>Star</code> is <a href="https://hackage.haskell.org/package/pr… | |
299 <p>This gives us a whole pile of useful instances, and we can even use i… | |
300 <p>Let’s assume the existence of a simple decoder of <code>Int</code> … | |
301 <div class="sourceCode" id="cb3"><pre class="sourceCode haskell"><code c… | |
302 <span id="cb3-2"><a href="#cb3-2" aria-hidden="true"></a>decodeInt <span… | |
303 <span id="cb3-3"><a href="#cb3-3" aria-hidden="true"></a></span> | |
304 <span id="cb3-4"><a href="#cb3-4" aria-hidden="true"></a>decodeAtKey</sp… | |
305 <span id="cb3-5"><a href="#cb3-5" aria-hidden="true"></a><span class="ot… | |
306 <span id="cb3-6"><a href="#cb3-6" aria-hidden="true"></a> <span class="… | |
307 <span id="cb3-7"><a href="#cb3-7" aria-hidden="true"></a>decodeAtKey k (… | |
308 <span id="cb3-8"><a href="#cb3-8" aria-hidden="true"></a> <span class="… | |
309 <p>So far, so good. We could go even further and decode the <code>[HashM… | |
310 <div class="sourceCode" id="cb4"><pre class="sourceCode haskell"><code c… | |
311 <span id="cb4-2"><a href="#cb4-2" aria-hidden="true"></a>encodeInt <span… | |
312 <span id="cb4-3"><a href="#cb4-3" aria-hidden="true"></a></span> | |
313 <span id="cb4-4"><a href="#cb4-4" aria-hidden="true"></a>encodeAtKey</sp… | |
314 <span id="cb4-5"><a href="#cb4-5" aria-hidden="true"></a><span class="ot… | |
315 <span id="cb4-6"><a href="#cb4-6" aria-hidden="true"></a> <span class="… | |
316 <span id="cb4-7"><a href="#cb4-7" aria-hidden="true"></a>encodeAtKey k (… | |
317 <span id="cb4-8"><a href="#cb4-8" aria-hidden="true"></a> f i <span cla… | |
318 <p>Here’s where the cracks creep in. We’d like to <code>mconcat</cod… | |
319 <div class="sourceCode" id="cb5"><pre class="sourceCode haskell"><code c… | |
320 <span id="cb5-2"><a href="#cb5-2" aria-hidden="true"></a><span class="ot… | |
321 <span id="cb5-3"><a href="#cb5-3" aria-hidden="true"></a> <span class="… | |
322 <span id="cb5-4"><a href="#cb5-4" aria-hidden="true"></a>encodeAtKey k (… | |
323 <span id="cb5-5"><a href="#cb5-5" aria-hidden="true"></a> <span class="… | |
324 <span id="cb5-6"><a href="#cb5-6" aria-hidden="true"></a></span> | |
325 <span id="cb5-7"><a href="#cb5-7" aria-hidden="true"></a><span class="ot… | |
326 <span id="cb5-8"><a href="#cb5-8" aria-hidden="true"></a>collectHashMap … | |
327 <span id="cb5-9"><a href="#cb5-9" aria-hidden="true"></a> <span class="… | |
328 <p>To do this, we’ve had to abandon any pretense of generality in the … | |
329 <h2 id="what-about-optics">What About Optics?</h2> | |
330 <p>Let’s go back to when things were going well, and look more closely… | |
331 <div class="sourceCode" id="cb6"><pre class="sourceCode haskell"><code c… | |
332 <span id="cb6-2"><a href="#cb6-2" aria-hidden="true"></a><span class="ot… | |
333 <span id="cb6-3"><a href="#cb6-3" aria-hidden="true"></a> <span class="… | |
334 <span id="cb6-4"><a href="#cb6-4" aria-hidden="true"></a> <span class="… | |
335 <span id="cb6-5"><a href="#cb6-5" aria-hidden="true"></a> <span class="… | |
336 <p>This seems promising, and if we step into the <code>lens</code> unive… | |
337 <div class="sourceCode" id="cb7"><pre class="sourceCode haskell"><code c… | |
338 <span id="cb7-2"><a href="#cb7-2" aria-hidden="true"></a>int <span class… | |
339 <span id="cb7-3"><a href="#cb7-3" aria-hidden="true"></a></span> | |
340 <span id="cb7-4"><a href="#cb7-4" aria-hidden="true"></a>preview<span cl… | |
341 <span id="cb7-5"><a href="#cb7-5" aria-hidden="true"></a>review<span cla… | |
342 <p>Trouble is, it’s very easy to lose prism-ness, and find ourselves s… | |
343 <div class="sourceCode" id="cb8"><pre class="sourceCode haskell"><code c… | |
344 <span id="cb8-2"><a href="#cb8-2" aria-hidden="true"></a>atKey k pr <spa… | |
345 <span id="cb8-3"><a href="#cb8-3" aria-hidden="true"></a> (HashMap.sing… | |
346 <span id="cb8-4"><a href="#cb8-4" aria-hidden="true"></a> (HashMap.look… | |
347 <p>We’ve found ourselves back at our first problem: we’re making sin… | |
348 <h2 id="pickler-combinators">Pickler Combinators</h2> | |
349 <p>How else can we keep encoding and decoding together? I came across a … | |
350 <div class="sourceCode" id="cb9"><pre class="sourceCode haskell"><code c… | |
351 <span id="cb9-2"><a href="#cb9-2" aria-hidden="true"></a><span class="kw… | |
352 <p>Many examples in the paper do the equivalent of <a href="https://hack… | |
353 <h2 id="what-next">What Next?</h2> | |
354 <p>I’m not really satisfied by any of the options in this post, but th… | |
355 <div class="sourceCode" id="cb10"><pre class="sourceCode haskell"><code … | |
356 <p>While I haven’t found a good story for bidirectional {en,de}coding,… | |
357 <ul> | |
358 <li>With <code>g ~ Either AnError</code>, you can report failure;</li> | |
359 <li>With <code>g ~ Endo</code>, you can build up maps or other data stru… | |
360 <li>With <code>g ~ Compose IO (Const ())</code>, you can execute actions… | |
361 <li>With <code>g ~ ((,) i)</code>, you can pass unconsumed input to a do… | |
362 </ul> | |
363 <p>There’s a few things I’m hoping to do, to see whether or not this… | |
364 <ul> | |
365 <li>Build a vocabulary of combinators to lift <code>Coder</code>s in and… | |
366 <li>Build out a vocabulary of primitive {en,de}-coders for DynamoDB <cod… | |
367 <li>Work out how to make the different functors for the <code>g</code> p… | |
368 <li>Decide whether the <code>f</code> parameter on the input is worth th… | |
369 </ul>]]></description> | |
370 <pubDate>Tue, 03 Nov 2020 13:00:00 UT</pubDate> | |
371 <guid>http://jackkelly.name/blog/archives/2020/11/03/profunctor_deco… | |
372 <dc:creator>Jack Kelly</dc:creator> | |
373 </item> | |
374 <item> | |
375 <title>Accidentally-Quadratic HashMaps</title> | |
376 <link>http://jackkelly.name/blog/archives/2020/10/16/accidentally-qu… | |
377 <description><![CDATA[<p><strong>TL;DR:</strong> Unless you’re car… | |
378 <ol type="1"> | |
379 <li><p>Building a <code>Map</code> (from <a href="https://hackage.haskel… | |
380 <li><p>Using <code>foldr</code> or <code>foldl</code> with <code>insert<… | |
381 <li><p>Using <code>foldMap</code> to build an intermediate list <code>[(… | |
382 </ol> | |
383 <p>Shout-out to <a href="https://luke.worth.id.au/">Luke Worth</a> who f… | |
384 <!--more--> | |
385 <h2 id="foldmap"><code>foldMap</code></h2> | |
386 <p>The <code>foldMap</code> function is a very convenient way to build u… | |
387 <div class="sourceCode" id="cb1"><pre class="sourceCode haskell"><code c… | |
388 <span id="cb1-2"><a href="#cb1-2" aria-hidden="true"></a></span> | |
389 <span id="cb1-3"><a href="#cb1-3" aria-hidden="true"></a><span class="co… | |
390 <span id="cb1-4"><a href="#cb1-4" aria-hidden="true"></a><span class="fu… | |
391 <span id="cb1-5"><a href="#cb1-5" aria-hidden="true"></a><span class="ot… | |
392 <span id="cb1-6"><a href="#cb1-6" aria-hidden="true"></a> <span class="… | |
393 <p>You map each <code>a</code> to a map (usually with the <code>singleto… | |
394 <p>The <code>Monoid</code> instance for <code>HashMap</code> is implemen… | |
395 <div class="sourceCode" id="cb2"><pre class="sourceCode haskell"><code c… | |
396 <p>Assume each <code>m_i</code> is a singleton map (size <span class="ma… | |
397 <ul> | |
398 <li><p><span class="math inline"><em>K</em><sub>1</sub></span>, the cost… | |
399 <li><p><span class="math inline"><em>K</em><sub>2</sub></span>, the cost… | |
400 <li><p><span class="math inline"><em>K</em><sub>3</sub></span>, the cost… | |
401 <li><p>Generally, the cost of the <span class="math inline"><em>i</em><s… | |
402 </ul> | |
403 <p>If you expand out the <span class="math inline"><em>K</em><sub><em>N<… | |
404 <h2 id="why-is-map-fine">Why is <code>Map</code> Fine?</h2> | |
405 <p><a href="https://hackage.haskell.org/package/containers-0.6.0.1/docs/… | |
406 <h2 id="what-if-i-need-hashmap">What if I Need <code>HashMap</code>?</h2> | |
407 <p>There are at least a couple of ways to turn a <code>Foldable</code> i… | |
408 <ol type="1"> | |
409 <li><p><code>HashMap</code>’s <a href="https://hackage.haskell.org/pac… | |
410 <li><p>If you’re not building singleton maps, you could try building a… | |
411 </ol> | |
412 <h2 id="conclusion">Conclusion</h2> | |
413 <p><code>Map</code> can be surprisingly fast, and <code>HashMap</code> c… | |
414 <pubDate>Fri, 16 Oct 2020 13:00:00 UT</pubDate> | |
415 <guid>http://jackkelly.name/blog/archives/2020/10/16/accidentally-qu… | |
416 <dc:creator>Jack Kelly</dc:creator> | |
417 </item> | |
418 <item> | |
419 <title>Building and Importing NixOS AMIs on EC2</title> | |
420 <link>http://jackkelly.name/blog/archives/2020/08/30/building_and_im… | |
421 <description><![CDATA[<p><strong>Update (2020-09-03):</strong> <a hr… | |
422 <p><strong>Update (2020-11-29):</strong> Added notes on the impact of in… | |
423 <p>The <a href="https://nixos.org">NixOS</a> project publishes Amazon Ma… | |
424 <h2 id="getting-a-nixos-ami">Getting a NixOS AMI</h2> | |
425 <p>There are few good ways to get AMI IDs for NixOS project images:</p> | |
426 <ul> | |
427 <li><p>The NixOS project publishes its images with <code>owner-id=080433… | |
428 <pre><code># Return the most recent AArch64 NixOS image in the region | |
429 $ aws ec2 describe-images \ | |
430 --region ap-southeast-2 \ | |
431 --filters Name=owner-id,Values=080433136561 \ | |
432 | jq '.Images | map(select(.Architecture == "arm64")) | … | |
433 { | |
434 "ImageId": "ami-05446a2f818cd3263", | |
435 "Description": "NixOS 20.03.2351.f8248ab6d9e aarch64-li… | |
436 }</code></pre></li> | |
437 <li><p>The <a href="https://nixos.org/download.html">NixOS download page… | |
438 <li><p>There is a list of AMIs going back to NixOS 14.04 in <a href="htt… | |
439 <pre><code>$ nix eval --raw '(import <nixpkgs/nixos/modules/virtu… | |
440 ami-04c0f3a75f63daddd</code></pre></li> | |
441 </ul> | |
442 <!--more--> | |
443 <h2 id="configuring-nixos-inside-the-ami">Configuring NixOS inside the A… | |
444 <p>The NixOS AMIs can rebuild themselves from NixOS configuration in <a … | |
445 <div class="sourceCode" id="cb3"><pre class="sourceCode nix"><code class… | |
446 <span id="cb3-2"><a href="#cb3-2" aria-hidden="true"></a><span class="co… | |
447 <span id="cb3-3"><a href="#cb3-3" aria-hidden="true"></a></span> | |
448 <span id="cb3-4"><a href="#cb3-4" aria-hidden="true"></a><span class="kw… | |
449 <span id="cb3-5"><a href="#cb3-5" aria-hidden="true"></a><span class="kw… | |
450 <span id="cb3-6"><a href="#cb3-6" aria-hidden="true"></a> <span class="… | |
451 <span id="cb3-7"><a href="#cb3-7" aria-hidden="true"></a><span class="kw… | |
452 <p>On each boot the system refreshes its configuration:</p> | |
453 <ul> | |
454 <li><p><code>root</code>’s channels are replaced with the ones listed … | |
455 <li><p>If any channels were found, <code>nix-channel --update</code> run… | |
456 <li><p><code>/etc/nixos/configuration.nix</code> is replaced with the en… | |
457 <li><p><code>nixos-rebuild switch</code> runs, rebuilding the OS.</p></l… | |
458 </ul> | |
459 <p>If you only want this to happen once, you can set <code>systemd.servi… | |
460 <h3 id="how-it-works">How it Works</h3> | |
461 <p>EC2 instance meta data and user data (if it exists) gets downloaded f… | |
462 <ul> | |
463 <li><p>A script on the initramfs will query the IMDS and download the us… | |
464 <li><p>On each boot, a systemd service called <a href="https://github.co… | |
465 <ul> | |
466 <li><p>Sets the host name, if not set by the NixOS configuration (<a hre… | |
467 <li><p>Sets root’s <code>authorized_keys</code> file to contain the fi… | |
468 <li><p>Checks for SSH host keypairs in user data, treating the user data… | |
469 </ul></li> | |
470 <li><p>On each boot, a systemd service called <a href="https://github.co… | |
471 <li><p>On each boot, a systemd service called <a href="https://github.co… | |
472 </ul> | |
473 <h2 id="customising-your-nixos-amis">Customising your NixOS AMIs</h2> | |
474 <p>Evaluating a full NixOS configuration on each boot can take a lot of … | |
475 <p>A tool like <a href="https://www.packer.io/">Packer</a> can help you … | |
476 <ul> | |
477 <li><p>Upload <code>configuration.nix</code> and replace <code>/etc/nixo… | |
478 <li><p>Invoke <code>nixos-rebuild switch --upgrade</code> to build the n… | |
479 <li><p>(Optional) Run <code>nix-collect-garbage -d</code> to remove old … | |
480 </ul> | |
481 <p>There is one more <strong>very important</strong> step you must do at… | |
482 <p>Here’s a simple packer configuration that provisions a NixOS AMI wi… | |
483 <details> | |
484 <summary> | |
485 <code>nixos-packer-example.json</code> | |
486 </summary> | |
487 <div class="sourceCode" id="cb4"><pre class="sourceCode json"><code clas… | |
488 <span id="cb4-2"><a href="#cb4-2" aria-hidden="true"></a> <span class="… | |
489 <span id="cb4-3"><a href="#cb4-3" aria-hidden="true"></a> <span class… | |
490 <span id="cb4-4"><a href="#cb4-4" aria-hidden="true"></a> <span cla… | |
491 <span id="cb4-5"><a href="#cb4-5" aria-hidden="true"></a> <span cla… | |
492 <span id="cb4-6"><a href="#cb4-6" aria-hidden="true"></a> <span cla… | |
493 <span id="cb4-7"><a href="#cb4-7" aria-hidden="true"></a> <span cla… | |
494 <span id="cb4-8"><a href="#cb4-8" aria-hidden="true"></a> <span cla… | |
495 <span id="cb4-9"><a href="#cb4-9" aria-hidden="true"></a> <span c… | |
496 <span id="cb4-10"><a href="#cb4-10" aria-hidden="true"></a> <sp… | |
497 <span id="cb4-11"><a href="#cb4-11" aria-hidden="true"></a> <span… | |
498 <span id="cb4-12"><a href="#cb4-12" aria-hidden="true"></a> <span… | |
499 <span id="cb4-13"><a href="#cb4-13" aria-hidden="true"></a> <span… | |
500 <span id="cb4-14"><a href="#cb4-14" aria-hidden="true"></a> <sp… | |
501 <span id="cb4-15"><a href="#cb4-15" aria-hidden="true"></a> <span… | |
502 <span id="cb4-16"><a href="#cb4-16" aria-hidden="true"></a> <span c… | |
503 <span id="cb4-17"><a href="#cb4-17" aria-hidden="true"></a> <span cla… | |
504 <span id="cb4-18"><a href="#cb4-18" aria-hidden="true"></a> <span class… | |
505 <span id="cb4-19"><a href="#cb4-19" aria-hidden="true"></a> <span class… | |
506 <span id="cb4-20"><a href="#cb4-20" aria-hidden="true"></a> <span cla… | |
507 <span id="cb4-21"><a href="#cb4-21" aria-hidden="true"></a> <span c… | |
508 <span id="cb4-22"><a href="#cb4-22" aria-hidden="true"></a> <span c… | |
509 <span id="cb4-23"><a href="#cb4-23" aria-hidden="true"></a> <span c… | |
510 <span id="cb4-24"><a href="#cb4-24" aria-hidden="true"></a> <span cla… | |
511 <span id="cb4-25"><a href="#cb4-25" aria-hidden="true"></a> <span cla… | |
512 <span id="cb4-26"><a href="#cb4-26" aria-hidden="true"></a> <span c… | |
513 <span id="cb4-27"><a href="#cb4-27" aria-hidden="true"></a> <span c… | |
514 <span id="cb4-28"><a href="#cb4-28" aria-hidden="true"></a> <span… | |
515 <span id="cb4-29"><a href="#cb4-29" aria-hidden="true"></a> <span… | |
516 <span id="cb4-30"><a href="#cb4-30" aria-hidden="true"></a> <span… | |
517 <span id="cb4-31"><a href="#cb4-31" aria-hidden="true"></a> <span… | |
518 <span id="cb4-32"><a href="#cb4-32" aria-hidden="true"></a> <span c… | |
519 <span id="cb4-33"><a href="#cb4-33" aria-hidden="true"></a> <span cla… | |
520 <span id="cb4-34"><a href="#cb4-34" aria-hidden="true"></a> <span class… | |
521 <span id="cb4-35"><a href="#cb4-35" aria-hidden="true"></a><span class="… | |
522 </details> | |
523 <details> | |
524 <summary> | |
525 <code>configuration.nix</code> | |
526 </summary> | |
527 <div class="sourceCode" id="cb5"><pre class="sourceCode nix"><code class… | |
528 <span id="cb5-2"><a href="#cb5-2" aria-hidden="true"></a></span> | |
529 <span id="cb5-3"><a href="#cb5-3" aria-hidden="true"></a><span class="kw… | |
530 <span id="cb5-4"><a href="#cb5-4" aria-hidden="true"></a> <span class="… | |
531 <span id="cb5-5"><a href="#cb5-5" aria-hidden="true"></a> <span class="… | |
532 <span id="cb5-6"><a href="#cb5-6" aria-hidden="true"></a> <span class="… | |
533 <span id="cb5-7"><a href="#cb5-7" aria-hidden="true"></a><span class="kw… | |
534 </details> | |
535 <p>Save the two files to the same directory, and run <code>packer build … | |
536 <h3 id="instance-resource-limits">Instance Resource Limits</h3> | |
537 <p><code>nixos-rebuild</code> can easily use all the instance’s disk s… | |
538 <div class="sourceCode" id="cb6"><pre class="sourceCode json"><code clas… | |
539 <span id="cb6-2"><a href="#cb6-2" aria-hidden="true"></a> <span class="… | |
540 <span id="cb6-3"><a href="#cb6-3" aria-hidden="true"></a> <span class… | |
541 <span id="cb6-4"><a href="#cb6-4" aria-hidden="true"></a> <span class… | |
542 <span id="cb6-5"><a href="#cb6-5" aria-hidden="true"></a> <span class… | |
543 <span id="cb6-6"><a href="#cb6-6" aria-hidden="true"></a> <span class… | |
544 <span id="cb6-7"><a href="#cb6-7" aria-hidden="true"></a> <span class="… | |
545 <span id="cb6-8"><a href="#cb6-8" aria-hidden="true"></a><span class="ot… | |
546 <p>Some builds (e.g., anything that triggers a rebuild of NixOS document… | |
547 <h2 id="building-nixos-amis-from-scratch">Building NixOS AMIs from Scrat… | |
548 <p>Customising NixOS AMIs with a tool like <code>packer</code> lets you … | |
549 <p>You can build a <code>.vhd</code> virtual HD image using the infrastr… | |
550 <pre><code>$ nix-build '<nixpkgs/nixos/release.nix>' \ | |
551 -A amazonImage.x86_64-linux \ | |
552 --arg configuration /path/to/configuration.nix</code></pre> | |
553 <p>These builds boot a VM to finish the build, so you will want ample CP… | |
554 <p>The <a href="https://github.com/nix-community/nixos-generators">nixos… | |
555 <p>Either way, once you’ve built the <code>.vhd</code> file, you’ll … | |
556 <p>(It should also be possible to specify <code>-A amazonImage.aarch64-l… | |
557 <p>The <code>configuration</code> argument is not strictly necessary, bu… | |
558 <p>Once the build finishes, the symlink <code>result</code> will point t… | |
559 <h2 id="importing-the-image-into-an-ami">Importing the image into an AMI… | |
560 <p>Once you have built your image, you need to import it into EC2 as an … | |
561 <p>VM Import/Export needs an S3 bucket to store the images before trigge… | |
562 <details> | |
563 <summary> | |
564 <code>template.yaml</code> for VM Import | |
565 </summary> | |
566 <div class="sourceCode" id="cb8"><pre class="sourceCode yaml"><code clas… | |
567 <span id="cb8-2"><a href="#cb8-2" aria-hidden="true"></a><span class="fu… | |
568 <span id="cb8-3"><a href="#cb8-3" aria-hidden="true"></a><span class="fu… | |
569 <span id="cb8-4"><a href="#cb8-4" aria-hidden="true"></a><span class="at… | |
570 <span id="cb8-5"><a href="#cb8-5" aria-hidden="true"></a><span class="at… | |
571 <span id="cb8-6"><a href="#cb8-6" aria-hidden="true"></a><span class="at… | |
572 <span id="cb8-7"><a href="#cb8-7" aria-hidden="true"></a><span class="at… | |
573 <span id="cb8-8"><a href="#cb8-8" aria-hidden="true"></a><span class="at… | |
574 <span id="cb8-9"><a href="#cb8-9" aria-hidden="true"></a><span class="at… | |
575 <span id="cb8-10"><a href="#cb8-10" aria-hidden="true"></a><span class="… | |
576 <span id="cb8-11"><a href="#cb8-11" aria-hidden="true"></a><span class="… | |
577 <span id="cb8-12"><a href="#cb8-12" aria-hidden="true"></a><span class="… | |
578 <span id="cb8-13"><a href="#cb8-13" aria-hidden="true"></a><span class="… | |
579 <span id="cb8-14"><a href="#cb8-14" aria-hidden="true"></a><span class="… | |
580 <span id="cb8-15"><a href="#cb8-15" aria-hidden="true"></a><span class="… | |
581 <span id="cb8-16"><a href="#cb8-16" aria-hidden="true"></a></span> | |
582 <span id="cb8-17"><a href="#cb8-17" aria-hidden="true"></a><span class="… | |
583 <span id="cb8-18"><a href="#cb8-18" aria-hidden="true"></a><span class="… | |
584 <span id="cb8-19"><a href="#cb8-19" aria-hidden="true"></a><span class="… | |
585 <span id="cb8-20"><a href="#cb8-20" aria-hidden="true"></a><span class="… | |
586 <span id="cb8-21"><a href="#cb8-21" aria-hidden="true"></a><span class="… | |
587 <span id="cb8-22"><a href="#cb8-22" aria-hidden="true"></a><span class="… | |
588 <span id="cb8-23"><a href="#cb8-23" aria-hidden="true"></a><span class="… | |
589 <span id="cb8-24"><a href="#cb8-24" aria-hidden="true"></a><span class="… | |
590 <span id="cb8-25"><a href="#cb8-25" aria-hidden="true"></a><span class="… | |
591 <span id="cb8-26"><a href="#cb8-26" aria-hidden="true"></a><span class="… | |
592 <span id="cb8-27"><a href="#cb8-27" aria-hidden="true"></a><span class="… | |
593 <span id="cb8-28"><a href="#cb8-28" aria-hidden="true"></a><span class="… | |
594 <span id="cb8-29"><a href="#cb8-29" aria-hidden="true"></a><span class="… | |
595 <span id="cb8-30"><a href="#cb8-30" aria-hidden="true"></a><span class="… | |
596 <span id="cb8-31"><a href="#cb8-31" aria-hidden="true"></a><span class="… | |
597 <span id="cb8-32"><a href="#cb8-32" aria-hidden="true"></a><span class="… | |
598 <span id="cb8-33"><a href="#cb8-33" aria-hidden="true"></a><span class="… | |
599 <span id="cb8-34"><a href="#cb8-34" aria-hidden="true"></a><span class="… | |
600 <span id="cb8-35"><a href="#cb8-35" aria-hidden="true"></a><span class="… | |
601 <span id="cb8-36"><a href="#cb8-36" aria-hidden="true"></a><span class="… | |
602 <span id="cb8-37"><a href="#cb8-37" aria-hidden="true"></a><span class="… | |
603 <span id="cb8-38"><a href="#cb8-38" aria-hidden="true"></a><span class="… | |
604 <span id="cb8-39"><a href="#cb8-39" aria-hidden="true"></a><span class="… | |
605 <span id="cb8-40"><a href="#cb8-40" aria-hidden="true"></a><span class="… | |
606 <span id="cb8-41"><a href="#cb8-41" aria-hidden="true"></a><span class="… | |
607 <span id="cb8-42"><a href="#cb8-42" aria-hidden="true"></a><span class="… | |
608 <span id="cb8-43"><a href="#cb8-43" aria-hidden="true"></a><span class="… | |
609 <span id="cb8-44"><a href="#cb8-44" aria-hidden="true"></a><span class="… | |
610 <span id="cb8-45"><a href="#cb8-45" aria-hidden="true"></a><span class="… | |
611 <span id="cb8-46"><a href="#cb8-46" aria-hidden="true"></a><span class="… | |
612 <span id="cb8-47"><a href="#cb8-47" aria-hidden="true"></a><span class="… | |
613 <span id="cb8-48"><a href="#cb8-48" aria-hidden="true"></a><span class="… | |
614 <span id="cb8-49"><a href="#cb8-49" aria-hidden="true"></a><span class="… | |
615 <span id="cb8-50"><a href="#cb8-50" aria-hidden="true"></a><span class="… | |
616 <span id="cb8-51"><a href="#cb8-51" aria-hidden="true"></a><span class="… | |
617 </details> | |
618 <p>There are a few things to note before you use the <code>template.yaml… | |
619 <ul> | |
620 <li><p>The template only creates a bucket for import. I didn’t need to… | |
621 <li><p>The role must be called <code>vmimport</code> for VM Import/Expor… | |
622 <li><p>You will need to deploy the stack with <code>CAPABILITY_NAMED_IAM… | |
623 <li><p>If you try to pull the stack down, CloudFormation will not delete… | |
624 </ul> | |
625 <p>Once you have the role and bucket set up, you can import your NixOS i… | |
626 <ul> | |
627 <li><p>Uploads the <code>.vhd</code> image to S3 if it doesn’t already… | |
628 <li><p>Imports the <code>.vhd</code> from S3 to an EBS snapshot, by call… | |
629 <li><p>Waits for the snapshot import to finish, by calling <code>aws ec2… | |
630 <li><p>Registers the EBS snapshot as an AMI, by calling <code>aws ec2 … | |
631 <li><p>Waits for the registration to finish, by calling <code>aws ec2 … | |
632 <li><p>Makes the new AMI public, by calling <code>aws ec2 modify-image-a… | |
633 <li><p>Copies the AMI to all the other regions and makes them public, by… | |
634 </ul> | |
635 <p>For tinkering, it’s probably enough to comment out the calls to <co… | |
636 <h2 id="conclusion">Conclusion</h2> | |
637 <p>I think customising the NixOS project’s images with a tool like <co… | |
638 <pubDate>Sun, 30 Aug 2020 13:00:00 UT</pubDate> | |
639 <guid>http://jackkelly.name/blog/archives/2020/08/30/building_and_im… | |
640 <dc:creator>Jack Kelly</dc:creator> | |
641 </item> | |
642 <item> | |
643 <title>How to Follow an Issue</title> | |
644 <link>http://jackkelly.name/blog/archives/2020/08/26/how_to_follow_a… | |
645 <description><![CDATA[<p>Roughly six months ago, the COVID-19 pandem… | |
646 <p>Most people reading this are already rightfully suspicious of the Mur… | |
647 <p>I will use the tale of hydroxychloroquine as an example, because it�… | |
648 <!--more--> | |
649 <h2 id="hydroxychloroquine">Hydroxychloroquine</h2> | |
650 <p>At the start of August, the ABC published an article about <a href="h… | |
651 <ol type="1"> | |
652 <li>GLORIOUS LEADER MAKES SUN RISE FOR AMERICAN PATRIOTS</li> | |
653 <li>Sunlight is deadly. Stay safe, stay inside.</li> | |
654 </ol> | |
655 <p>Trump is really not that great, but his critics undermine themselves … | |
656 <blockquote> | |
657 ‘On March 19, Trump said the drug could be a “game changer” at a W… | |
658 </blockquote> | |
659 <p>Here’s what the <a href="https://www.youtube.com/watch?v=ScdYrN3BWT… | |
660 <blockquote> | |
661 “I think it’s going to be very exciting, I think it could be a game … | |
662 </blockquote> | |
663 <p>Notice that the word “could” is literally spoken by Trump, but is… | |
664 <p>If you want a decent article about the politicisation of HCQ, <a href… | |
665 <ul> | |
666 <li>The combination of HCQ and azithromycin;</li> | |
667 <li>Sometimes supplemented with zinc;</li> | |
668 <li>Delivered early in a person’s case of COVID-19.</li> | |
669 </ul> | |
670 <p>Nevertheless, most of the trials were run with HCQ alone as a last-re… | |
671 <p>I do not have an opinion on whether or not HCQ/AZ is effective — th… | |
672 <h2 id="sneaky-edits">Sneaky edits</h2> | |
673 <p>Look closely at the ABC article I linked at the start of this essay. … | |
674 <h2 id="how-to-properly-follow-an-issue">How to properly follow an issue… | |
675 <p>So how are you going to actually form an accurate view of an emerging… | |
676 <p>As you read articles, you need to build an archive to link everything… | |
677 <p>When you find older articles, check their edit history if you can. Th… | |
678 <p>The next level beyond “URLs and notes” is maintaining your own ar… | |
679 <p>Individual competent people are often a much better source than media… | |
680 <blockquote> | |
681 <p>Does everyone here know that i keep a daily log about covid-19? I’m… | |
682 Cant bullshit me | |
683 </blockquote> | |
684 <p>Unfortunately, the link to his website no longer works. But you can a… | |
685 <h2 id="how-well-did-i-do">How well did I do?</h2> | |
686 <p>How well did I follow the whole COVID-19 thing? I give myself a C-min… | |
687 <h2 id="conclusion">Conclusion</h2> | |
688 <p>If this all sounds like a lot of work, that’s because it is. If it … | |
689 <ol type="1"> | |
690 <li><p>Dip your toe in the water. Get <em>just enough</em> information s… | |
691 <li><p>Wade right in. Set up your archive, take notes, and be able to ba… | |
692 </ol> | |
693 <p>Anything in-between is not really worth it.</p>]]></description> | |
694 <pubDate>Wed, 26 Aug 2020 13:00:00 UT</pubDate> | |
695 <guid>http://jackkelly.name/blog/archives/2020/08/26/how_to_follow_a… | |
696 <dc:creator>Jack Kelly</dc:creator> | |
697 </item> | |
698 <item> | |
699 <title>Abstracting over Applicative, Alternative, Divisible, and Dec… | |
700 <link>http://jackkelly.name/blog/archives/2020/08/19/abstracting_ove… | |
701 <description><![CDATA[<p>Justin Le recently put out a two-part serie… | |
702 <div class="sourceCode" id="cb1"><pre class="sourceCode haskell"><code c… | |
703 <span id="cb1-2"><a href="#cb1-2" aria-hidden="true"></a><span class="ot… | |
704 <span id="cb1-3"><a href="#cb1-3" aria-hidden="true"></a><span class="ot… | |
705 <p>Let’s see if we can build one.</p> | |
706 <!--more--> | |
707 <p>In Ed Kmett’s 2015 talk, <a href="https://www.youtube.com/watch?v=c… | |
708 <div class="sourceCode" id="cb2"><pre class="sourceCode haskell"><code c… | |
709 <span id="cb2-2"><a href="#cb2-2" aria-hidden="true"></a><span class="kw… | |
710 <span id="cb2-3"><a href="#cb2-3" aria-hidden="true"></a> <span class="… | |
711 <span id="cb2-4"><a href="#cb2-4" aria-hidden="true"></a></span> | |
712 <span id="cb2-5"><a href="#cb2-5" aria-hidden="true"></a><span class="kw… | |
713 <span id="cb2-6"><a href="#cb2-6" aria-hidden="true"></a> <span class="… | |
714 <p>Then:</p> | |
715 <ul> | |
716 <li><code>Applicative</code> comes from covariant Day convolution with <… | |
717 <li><code>Alternative</code> comes from covariant Day convolution with <… | |
718 <li><code>Divisible</code> comes from contravariant Day convolution with… | |
719 <li><code>Decidable</code> comes from contravariant Day convolution with… | |
720 </ul> | |
721 <p><code>pure</code>, <code>empty</code>, and <code>conquer</code> can b… | |
722 <div class="sourceCode" id="cb3"><pre class="sourceCode haskell"><code c… | |
723 <span id="cb3-2"><a href="#cb3-2" aria-hidden="true"></a><span class="ot… | |
724 <span id="cb3-3"><a href="#cb3-3" aria-hidden="true"></a><span class="ot… | |
725 <span id="cb3-4"><a href="#cb3-4" aria-hidden="true"></a><span class="ot… | |
726 <span id="cb3-5"><a href="#cb3-5" aria-hidden="true"></a><span class="ot… | |
727 <p>And you can do the same with the “<code>liftA2</code>-equivalent”… | |
728 <div class="sourceCode" id="cb4"><pre class="sourceCode haskell"><code c… | |
729 <span id="cb4-2"><a href="#cb4-2" aria-hidden="true"></a>liftA2 (,)<span… | |
730 <span id="cb4-3"><a href="#cb4-3" aria-hidden="true"></a>\l r <span clas… | |
731 <span id="cb4-4"><a href="#cb4-4" aria-hidden="true"></a><span class="ot… | |
732 <span id="cb4-5"><a href="#cb4-5" aria-hidden="true"></a><span class="ot… | |
733 <p><a href="https://bartoszmilewski.com/2018/02/17/free-monoidal-functor… | |
734 <div class="sourceCode" id="cb5"><pre class="sourceCode haskell"><code c… | |
735 <span id="cb5-2"><a href="#cb5-2" aria-hidden="true"></a><span class="ot… | |
736 <span id="cb5-3"><a href="#cb5-3" aria-hidden="true"></a><span class="ot… | |
737 <p>That claim doesn’t sound quite right to me: without a <code>Functor… | |
738 <div class="sourceCode" id="cb6"><pre class="sourceCode haskell"><code c… | |
739 <span id="cb6-2"><a href="#cb6-2" aria-hidden="true"></a><span class="kw… | |
740 <span id="cb6-3"><a href="#cb6-3" aria-hidden="true"></a></span> | |
741 <span id="cb6-4"><a href="#cb6-4" aria-hidden="true"></a><span class="kw… | |
742 <span id="cb6-5"><a href="#cb6-5" aria-hidden="true"></a><span class="ot… | |
743 <span id="cb6-6"><a href="#cb6-6" aria-hidden="true"></a><span class="ot… | |
744 <span id="cb6-7"><a href="#cb6-7" aria-hidden="true"></a><span class="ot… | |
745 <span id="cb6-8"><a href="#cb6-8" aria-hidden="true"></a><span class="ot… | |
746 <p>You can define <code>newtype</code> wrappers which show that if you h… | |
747 <p>An interesting application is bidirectional parsing/printing. The fol… | |
748 <div class="sourceCode" id="cb7"><pre class="sourceCode haskell"><code c… | |
749 <span id="cb7-2"><a href="#cb7-2" aria-hidden="true"></a><span class="kw… | |
750 <span id="cb7-3"><a href="#cb7-3" aria-hidden="true"></a></span> | |
751 <span id="cb7-4"><a href="#cb7-4" aria-hidden="true"></a><span class="co… | |
752 <span id="cb7-5"><a href="#cb7-5" aria-hidden="true"></a><span class="kw… | |
753 <span id="cb7-6"><a href="#cb7-6" aria-hidden="true"></a></span> | |
754 <span id="cb7-7"><a href="#cb7-7" aria-hidden="true"></a><span class="kw… | |
755 <p>Operations built using <code>Monoidal</code> end up putting <code>(,)… | |
756 <p>I have a library implementing this machinery about 80% ready to publi… | |
757 <ol type="1"> | |
758 <li><p>What is this <code>Monoidal</code> class, exactly? I <em>think</e… | |
759 <li><p>I don’t especially like the fundep <code>| f -> p</code>, bu… | |
760 <li><p>For types with a <code>Monoidal</code> instance but no <code>Appl… | |
761 <li><p>The <code>Monoidal</code> class feels stuck in-between committing… | |
762 <li><p>If I break off a unitless superclass from <code>Monoidal</code> (… | |
763 </ol> | |
764 <p>If you have thoughts about this, please share them <a href="https://w… | |
765 <p><strong>Update (2020-08-23):</strong> After some excellent comments o… | |
766 <ul> | |
767 <li><p>It appears that there isn’t a lot of other uses for <code>Invar… | |
768 <li><p>Bidirectional parsing/printing can be done with <a href="https://… | |
769 <ul> | |
770 <li><p>There is also the work of Xia, Orchard, and Wang on <a href="http… | |
771 <li><p>If you have an existing <code>Divisible f</code> and an <code>App… | |
772 </ul></li> | |
773 <li><p>Asad Saeeduddin already has a more mature and more mathematically… | |
774 </ul> | |
775 <p><strong>Update (2020-11-03):</strong> I just found the 2004 <a href="… | |
776 <pubDate>Wed, 19 Aug 2020 13:00:00 UT</pubDate> | |
777 <guid>http://jackkelly.name/blog/archives/2020/08/19/abstracting_ove… | |
778 <dc:creator>Jack Kelly</dc:creator> | |
779 </item> | |
780 <item> | |
781 <title>Enforcing the Consequent</title> | |
782 <link>http://jackkelly.name/blog/archives/2020/06/08/enforcing_the_c… | |
783 <description><![CDATA[<p>To successfully do anything at all, you mus… | |
784 <p>This phenomenon feels like a special case of <a href="https://www.les… | |
785 <ul> | |
786 <li>Suppose that you know that <span class="math inline"><em>A</em></spa… | |
787 <li>You want more <span class="math inline"><em>A</em></span>, but you d… | |
788 <li>Solution: boost <span class="math inline"><em>B</em></span> to high … | |
789 </ul> | |
790 <p>Boosting <span class="math inline"><em>B</em></span> so aggressively … | |
791 <!--more--> | |
792 <h2 id="higher-education">Higher Education</h2> | |
793 <p>A university education used to be a near-certain ticket to a good job… | |
794 <p>Sustaining this growth is a funding challenge, and universities have … | |
795 <p><strong>This is enforcing the consequent.</strong> Having decided tha… | |
796 <p>This has predictable <a href="https://www.macrobusiness.com.au/2017/1… | |
797 <h2 id="who">WHO</h2> | |
798 <p>A larger, more recent, and possibly more dangerous example, and the r… | |
799 <p>If the World Health Organisation fails to secure world health, it is … | |
800 <p>There’s no point having an organisation like the WHO unless it is t… | |
801 <ul> | |
802 <li>The entities that give the best advice will be the most trusted.</li> | |
803 <li>The WHO needs to give better advice about world health, but fixing t… | |
804 <li>Solution: the tech companies will make the WHO the most trusted sour… | |
805 </ul> | |
806 <p>Let’s all hope like hell that the WHO magically does better next ti… | |
807 <h2 id="why-it-scares-me">Why it Scares Me</h2> | |
808 <p>The common thread connecting these examples is the intentional decisi… | |
809 <p>Lowering standards to pass more students blinds a university’s inte… | |
810 <p>Large organisations like the WHO digest information and speak truth s… | |
811 <p>In both cases, the policy changes amount to putting on the blinders a… | |
812 <p><strong>Exercise:</strong> look at the news media through this lens, … | |
813 <pubDate>Mon, 08 Jun 2020 13:00:00 UT</pubDate> | |
814 <guid>http://jackkelly.name/blog/archives/2020/06/08/enforcing_the_c… | |
815 <dc:creator>Jack Kelly</dc:creator> | |
816 </item> | |
817 <item> | |
818 <title>Changing the Distance Metric</title> | |
819 <link>http://jackkelly.name/blog/archives/2020/05/19/changing_the_di… | |
820 <description><![CDATA[<p>Mathematics has this idea of a <em>metric</… | |
821 <ol type="1"> | |
822 <li><p>The distance between <span class="math inline"><em>x</em></span> … | |
823 <li><p>Symmetry: The distance between <span class="math inline"><em>x</e… | |
824 <li><p>Triangle Inequality: If you’re going between <span class="math … | |
825 </ol> | |
826 <!--more--> | |
827 <p>Euclidian distance, given by the Pythagorean Theorem you might rememb… | |
828 <p>It is obvious that the coronavirus lockdowns have messed with our per… | |
829 <p>The analogy isn’t perfect — timezone differences still make thing… | |
830 <pubDate>Tue, 19 May 2020 13:00:00 UT</pubDate> | |
831 <guid>http://jackkelly.name/blog/archives/2020/05/19/changing_the_di… | |
832 <dc:creator>Jack Kelly</dc:creator> | |
833 </item> | |
834 | |
835 </channel> | |
836 </rss> |