Author’s note: I wrote this a while ago, but decided that I wanted to look up and add some statistics before publishing it. That’s probably never going to happen, so here is the post as it stands.

I’ve started reading Jon Ronson’s *So You’ve Been Publicly Shamed*, which has been on my list for a while after I’ve enjoyed much of his other work. In the fourth chapter, he quotes Justine Sacco, whose somewhat racist tweet went viral while she was on an 11-hour flight, as saying “it’s not like I can date, because we google everyone we might date”. Now, I’m not particularly interested in the morals of what happened to Justine Sacco and her tweet (though I might have some thoughts for a later post after I finish the book), but this sentence caught my attention. The idea of looking online to see if some romantic interest had a shady past of off-colour jokes on social media would never occur to me.

I’m certainly not so naïve to be unaware that people do this. But what makes me different? The two things that first come to mind are nationality and gender. I am an English man, and Justine Sacco is a South African-American woman. It would be very surprising if we had an identical experience of dating. Still, gender perhaps is less likely: Sacco is talking about her potential partners, not herself, and if she is interested in men, then that includes me. So it is more likely down to culture or simply personality differences^{1}.

Bemoaning the Americani{s/z}ation of British culture is one of many celebrated national pastimes, and by no means is the world of romance exempt from trans-Atlantic influence, perhaps significantly due to American-based websites. Still, we are different {to/from/than} our cousins across the pond and obviously so will be our behavio{u}r with respect to relationships.

British people are stereotypically more reserved and respectful of status differences than Americans. We still enjoy gossip behind people’s backs, but social class is often given away through speech and mannerisms, obviating much of a need to research someone’s background. I don’t have much concrete to back this up, but it doesn’t feel too difficult to justify myself using national tendencies in this way.

On the other hand, my justification of the previous paragraph feels a little like a just-so story, and I suspect that I could come up with an equally convincing argument in the other direction had my initial intuition been different. What I am best qualified to talk about is of course my own experience. How much do I pry into people’s online presence before I go on a date with them?

Clearly if I already know a person then this whole discussion is academic, so we are probably talking about someone I’ve just met, most likely through online dating. The content of a profile description is a starting point (interestingly unique to online dating, absent if you meet in a pub, at a concert or somewhere similar). If I’m particularly interested, then I might look up their social media accounts, although in search of more posts, more pictures and more personality rather than a life history. I tend to hold off sending actual friend requests until we’ve met a few times and established some actual in-person chemistry.

But why do I take this approach, and why isn’t researching all this information appealing to me? Fundamentally, I think it comes down to three things. Firstly, it simply feels like an intrusion. This possibly comes from my British reservedness and natural introversion, but I don’t particularly like the idea of someone googling me, and therefore I reciprocally choose not to do it to others. Mostly it’s probably not a significant problem, since people can control to some extent what is publicly associated with them, but I prefer to err on the side of caution. Secondly, and somewhat relatedly, the simple act of finding out about each other is a major part of the point and fun of dating people. I could google someone and find their name on a list of graduates of some university, or I could listen to them talk about what they studied, hear why they find that interesting, where the best pubs are in that city and what memorable stories happened in them.

And finally, I think the most important part of a person is how they think and act now, not five years ago. I hold willingness to forgive as a cardinal virtue, and knowledge of some past crime only matters to me as a prior for that person doing it again. If they can convince me that they repent of whatever grevious sin is hiding in their past, then I will not hold it against them. I don’t mean to imply that someone’s past is completely insignificant: of course personal history has a huge effect on the present self. But we are not our mistakes. What matters is our ability to accept them and their consequences, to learn from them and to avoid making them all over again.

Although perhaps she is falling prey to the typical mind fallacy, a common trap where people assume that others reason in the same way as themselves. I can imagine that a woman who could reasonably feel more vulnerable to predatory partners than a man would might want to be more confident of a date’s background.↩

The changes … shined a national spotlight

In particular, the usage of “shined” over “shone” seemed very unnatural to me. As a result of doing a little research on this, both words have now completely lost any meaning. I hope that someone reads this blog post so it was all worth it.

My first stop was the entry on Wiktionary, which lists both “shined” and “shone” as equally acceptable simple past or participle forms. I didn’t think that this was quite right, so I continued my digging. A search for “shined or shone” revealed the usual mass of grammar blogs. The top result was Grammarist, which has a very short entry saying that historically, “shone” was for something emitting light, and “shined” was for polishing something, although in modern usage this is less strictly adhered to. Most other results had a similar, although not quite the same, transitive vs intransitive distinction. One even mentioned a mnemonic “rhyme”: “shone stands alone”.

I put “rhyme” in scare quotes there because in my (British English RP) accent it doesn’t rhyme at all: “shone” as in “gone” and “alone” as in “moan”. This reinforces my initial intuition that there is some British vs American difference here. Inspired by my favourite blog about such differences, Separated by a Common Language, whose post on this I only thought to search for after doing all this other research myself, I looked up the two words in a corpus:

And there we have it: “shone” is proportionally much more common in British (and Commonwealth) English than it is in American. Now you should go read that SbaCL post because it’s written by someone who actually studies this stuff for a living.

]]>I’ve never been a prolific blogger or writer of anything much in particular. At school, essay subjects were my least favourite, and after my English GCSE, the most words I put together in one go were in my UCAS personal statement. Over my undergraduate degree I ended up writing more, as higher level maths leads to more involved proofs needing more explanation, but it’s a very different style to general prose.

On the other hand, from a young age I was a prolific reader. I think I mostly inherited this from my mother, but it became an important part of my personality growing up. I wasn’t fussy: novels, short stories, popular science books, random magazines lying around the house. My reading habit has waxed and waned over the years, but I was always aware of the existence of people who put words together for a living.

Now I’m a PhD student, and for the first time I have to write journal papers and eventually (though a lot sooner than I like to think about) a full thesis. The most consistent piece of writing advice I’ve seen is simply to write as much as possible and not care that the first x thousand words will suck. So one reason is definitely to get to the the point of being able to explain complex topics clearly and engagingly, at least to expert audiences.

With that said, merely practising the art of writing isn’t the only motivating factor. I haven’t come up with a title or tagline for this website mostly to leave myself the freedom to write what I, and hopefully others, find interesting. Granted, so far that’s been weird parts of category theory and overcoming very specific technical issues in little-used software, but I have some thoughts about the broader world of modern society and technology that I want to get to very soon. In fact, this post is at least the start of unravelling all those issues.

Another aspect is to rubber-duck my life in some sense. It’s a common experience to start asking some question (technical or otherwise) and realise that the act of structuring it into words makes the solution clearer, and I hope to be able to apply this to real-life situations I find myself in, ideally where I can come up with some novel or useful observation. I don’t have anything particular in mind in this genre yet, but it’s something that I want to leave myself open to.

And finally, I may eventually have some political or philosophical opinions I want to clarify and share. This builds on my previous point, as the aim is to not only rubber-duck myself into some sort of coherent thinking, but also force myself to do the research. I’m a big believer in intellectual humility, and there’s a lot that I freely admit I don’t know enough about to have even a private opinion of.

So this post will stand, at least for now, as my justification for this exercise in putting words on the internet. As always, if you have any comments, feedback or anything else to say to me, I’d welcome it via email, Twitter, carrier pigeon or any other means of contact you have.

]]>`.html`

suffixes everywhere (inspired by/ripped off from Rohan Jain) initially didn’t quite work right with it, so I’ll document how I fixed this below.
In the original method, clean URLs are implemented in two parts: first `cleanRoute`

routes `foo.md`

to `foo/index.html`

, and then `cleanIndexUrls`

rewrites internal links to remove all the `index.html`

suffixes; see the post for more details. Up to now, this worked well enough, but when the feeds are generated, `index.html`

is left in the links, and on closer inspection, it’s missing the point somehow. Hakyll URLs are generated via the `url`

field attached to `defaultContext`

, which eventually comes from the following:

```
urlField :: String -> Context a
urlField key = field key $
fmap (maybe empty toUrl) . getRoute . itemIdentifier
```

So we can see that it all comes down to the `Route`

of the item. In the case of `cleanRoute`

, this is going to include the `index.html`

. Rather than including this in the URLs and then stripping them out later with `cleanIndexUrls`

, it seems much cleaner to redefine the `url`

field in the context to something more canonically correct. Thus:

```
cleanUrlField :: String -> Context a
cleanUrlField key = field key $
fmap (maybe empty (cleanIndex . toUrl)) .
getRoute .
itemIdentifier
myContext :: Context String
myContext =
cleanUrlField "url" <>
defaultContext
```

With this change, we don’t need to run `cleanIndexUrls`

any more, and the feed generator code picks up the correct URL to place in the Atom and RSS feeds. You can see the full `site.hs`

file with these changes here.

A monad (on some category \( \mathcal{C} \) ), historically also known as a triple, consists of three pieces of data:

- a functor \( T : \mathcal{C} \rightarrow \mathcal{C} \);
- a natural transformation \( \eta = \eta^T : 1 \rightarrow T \) called the
*unit*; and - a natural transformation \( \mu = \mu^T: TT \rightarrow T \) called
*multiplication*

such that \( \mu \circ T\mu = \mu \circ \mu T \) (associativity) and \( \mu \circ T \eta = \mu \circ \eta T = 1 \) (unit law), famously summarised as “a monad is a monoid in the category of endofunctors”^{1}. Given a monad \( T \), we may form its *Kleisli category* \( \mathbf{Kl}(T) \), which has the same objects as the underlying category and where an arrow \( X \nrightarrow Y \) is a \( \mathcal{C} \)-arrow \( X \rightarrow TY \). I’ll use this different notation for Kleisli arrows because it’s important to keep straight the distinction between them and arrows in the underlying category. The identities are given by the unit maps \( \eta_X \) and composition of \(f: X \nrightarrow Y\) and \(g: Y \nrightarrow Z\) uses the multiplication:

\[ X \xrightarrow{f} TY \xrightarrow{Tg} TTZ \xrightarrow{\mu_Z} TZ \]

This construction is well-known from its use in functional programming to model effects.

Distributive laws come up a lot in the world of string diagrams and SMTs, where we use them to combine two theories together subject to some laws governing their interaction. The most familiar example of a distributive law is multiplication over addition: \[ a(b + c) = ab + ac \] Beck (p95) extended the notion to monads, defining a law distributing a monad \(S\) over a monad \(T\) to be a natural transformation \(\lambda: ST \rightarrow TS\) satisfying certain coherence laws. In the paper, he in fact gives a way to recover the multiplication/addition law back from this construction, which is pretty cool.

The main theorem related to distributive laws of monads is the equivalence of

- a distributive law of \(S\) over \(T\);
- a coherent multiplication on \(TS\);
- a lifting of \(T\) to the category of \(S\)-algebras (which I haven’t introduced, since it isn’t really relevant to this post); and
- a lifting of \(S\) to the Kleisli category of \(T\).

Now, this certainly is true, but this is where the hole appears. Beck’s original paper omits this last condition (perhaps because Kleisli categories weren’t widespread back then?). On the other hand, Cheng implicitly assumes the result for Kleisli categories. I have a feeling that it possibly follows out of the treatment of adjoint functors in Section 3 in the Beck paper, but I can’t quite get my head around it, and in any case I needed to write the construction down from first principles for my application.

To warm up, let’s look at the most well-known use for a distributive law \(\lambda : ST \to TS\): giving the composite functor \(TS\) a monad structure. Simply composing the units \(\eta^T \circ \eta^S \) gives a natural transformation which will be the unit of the composite monad, but the bit which actually requires a distributive law is defining a multiplication \(\mu^{TS} : TSTS \rightarrow TS \). It’s one of those times when there’s essentially only one thing you can write down, and that is exactly what you need:

\[ TSTS \xrightarrow{T \lambda S} TTSS \xrightarrow{\mu^T \mu^S} TS \]

and all the relevant coherence conditions match up to satisfy the monad laws.

For the Kleisli category, we need to define a monad \(\tilde{S}\) on \(\mathbf{Kl}(T)\). Even just to define the functor part we already need the distributive law: the objects are the same, but for a map \(f: X \nrightarrow Y\), we need to define

\[ \tilde{S}f: SX \rightarrow TSY = SX \xrightarrow{Sf} STY \xrightarrow{\lambda_Y} TSY \]

So handwaving over the proofs that this is a proper functor, we now just need a unit and multiplication. The unit is again just a composite of the constituent units: \[ \eta_X: X \nrightarrow \tilde{S}X = X \xrightarrow{\eta^S_X} SX \xrightarrow{\eta^T_{SX}} TSX \] and the multiplication is a little more fiddly, but still straightforward: \[ \mu_X: \tilde{S}\tilde{S}X \nrightarrow \tilde{S}X = SSX \xrightarrow{\mu^S_X} SX \xrightarrow{S\eta^T_X} STX \xrightarrow{\lambda_X} TSX \] And, again glossing over all the annoying coherence proofs, we’re done!

There are quite a few pieces I’ve left out of all of this, notably going back the other way, from a lifting of \(S\) to \(\mathbf{Kl}(T)\) to a distributive law \(ST \rightarrow TS\), and most of the verifications that all these things satisfy the laws they are supposed to, but this is mostly what I wanted to figure out. Hopefully it’s useful to someone other than me. Any mistakes or comments, send me an email or tweet and I’d be happy to discuss.

Still to be done are re-implementing some sort of mobile/responsive design, adding a more formal CV, generating an RSS feed, and perhaps even a publication list. There are also no doubt plenty of places that could use a little prettification; I make no claims to being talented at web design.

]]>