11 May 2020

[Haskell] I've been buying yet more Haskell books, in spite of the fact that many Haskell textbooks are now available free online, in the browser. Programming in Haskell by Graham Hutton came early last week. Graham Hutton appears on Computerphile in quite a few videos which clearly explain some tricky concepts in functional programming, and support the chapters of the book. Real World Haskell came later in the week — I ordered it because so many people seem to recommend it.

Not surprisingly, reading through Learn you a Haskell is many times faster now I've internalised some of the fundamentals from the Haskell Wikibook, and it's helped a ton in getting a different perspective on the intermediate stuff. Last week I whipped through most of the book, a little each evening alongside making bits of code. Lipovača explains things in a sufficiently different way that there were plenty of moments where things that haven't quite clicked before now make sense. I'll try reading through the other two books next.

My ambitions to play with algebras and monads with Haskell are all very well, but I need to get going on something a bit more humble. I love to go walking (known to Americans and Canadians as hiking, and some Brits as rambling). I've written some horrid Perl to convert my favourite routes, fastidiously built up from OpenStreetMap data, into something that I can copy to my GPS receiver. Then I can navigate with the route when I'm out on the trails, as well as share them with others in GPX format. The plan for the first half of this week is to reimplement this in Haskell and explore what tricks I can use to extend the functionality. So, a simple and extensible project, especially as most of the work has been done in the form of the gps package, but one that is likely to lead to several instructive afternoons.

[Go] Since the lockdown, Chris and I have had a weekly board game night using Tabletop Simulator inside Steam. Last week, however, we warmed up to the main game by having a quick unranked 9×9 game on Online Go Server, with Chris giving me helpful commentary and answering my questions over a voice chat. In 2017, Chris had taught participants of MathsJam Gathering how to play go on the games night there, and he did just a good a job with me. Hopefully this will become a regular thing.

My first proper exposure to go was shortly after I first moved to Cambridge in 2014 — a really fun time in my life. At that time, the CB1 internet café was still going strong. I was there having coffee and cake with Tim, himself a go player for several decades. A meeting of the Cambridge University Go Society happened to be taking place in the café around the same sort of time. A friendly — and likely highly-ranked — member of CUGS came over and teamed up with Tim to coach me for half an hour as I bumbled through a game. Each time there was a key move — good or bad — he would be able to rewind the game up to ten or more moves to illustrate another branch in the game tree. Otherwise, the coaching was in much the same style as Chris's. That is, the plan was just to place stones and introduce the rules and concepts as we went along. Then, like now, it struck me how when playing, what my brain is doing is mixing rule application with intuition, even from the very first game.

Back then, I got myself a copy of Neil Moffat's Learn Go and, for when I finished that, Go by Example. The books are full of diagrams and commentary, with a whole new diagram for each new move. And as clear and recommendable as these books (and the online tutorial) are, I get more out of learning when having a friendly game chatting over a board with someone better than me. Even if — for now at least — circumstances mean that that board is virtual.

There's lots of support for newcomers to the game online, for example Pages for Beginners in Sensei's Library, and Online Go Server has its own tutorials. There are popular puzzle sets like Exercises for Beginners, Beginning Shapes, or the puzzles from the elementary part of The Encyclopedia of Life and Death by Cho Chikun (조치훈).

Interestingly, go can be adapted fairly naturally to variants that use different board connections and tilings. There are even variants with no discrete cells at all. Playing go on the crystalline structure of diamond has been demonstrated by Henry Segerman, and he goes on to propose more general settings on general graphs and in topological spaces.

Online Go Server has features which support group play. As an experiment, Chris and I have set up an OGS group, just for fun and practice. If we get enough people we could play casual games or even play a 9×9 or 13×13 tournament. So, if you're interested please send us an invitation request.