Kleisli Composition à la Up-Goer Five

When you have a way to turn thing one into thing two, and you also have a way to turn thing two into thing three, you can put those ways of turning things into other things together, to make a way to turn thing one straight into thing three. That’s easy.

But if instead you only have a way to turn thing one into a box that has thing two inside, and a way to turn thing two into a box that has thing three inside, it’s harder, because you usually aren’t allowed to take anything out of a box. If you put those ways of turning things into boxes of other things together, you usually end up with a way to turn thing one into a box that has a box inside, that finally has thing three inside. That’s too many boxes!

Some boxes are cool, though: when you have a cool box that has another cool box inside, you’re allowed to throw one of the cool boxes away so that you only have one cool box left. That means that if you have a way to turn thing one into a cool box with thing two inside, and a way to turn thing two into a cool box with thing three inside, you aren’t left with too many boxes when you put them all together, only one.

There are different kinds of cool boxes. One kind of cool box lets you take things out, but only if you wait until they’re ready. So if you have a way to turn thing one into a cool box that will let you get thing two out later, and a way to turn thing two into a cool box that will let you get thing three out later, you can put them together to make a way to turn thing one straight into a cool box that will let you get thing three out later.

Another kind of cool box is almost like the first kind, but when you take things out, you might also get a surprise on the side. You usually don’t like surprises, so it’s best to wait until the world ends before you try to take things out. It’s safe to put them together though, just like before: if you have a way to turn thing one into a surprise-box of thing two, and a way to turn thing two into a surprise-box of thing three, you can make a way to turn thing one straight into a surprise-box of thing three without fucking up the surprises.

Another kind of cool box that people often use can have many of the same thing inside. So if you have a way to turn thing one into a cool box with many thing twos inside, and a way to turn thing two into a cool box with many thing threes inside, you can put them together to make a way to turn thing one straight into a cool box with many thing threes inside.

So remember the easy first part: when you have a way to turn thing one into thing two, and you also have a way to turn thing two into thing three, you can make a way to to turn thing one straight into thing three. You can keep doing this over and over until you run out of numbers for things. Cool boxes are just the same: when you have a way to turn thing one into a cool box of thing two, and a way to turn thing two into a cool box of thing three, you can always make a way to turn thing one straight into a cool box of thing three no matter what kind of cool box you have.

Edit

Sometimes people like to explain the cool boxes as if they were a kind of food. This kind of food first came from a warmer part of the world, down from where I live but not too far, where most people fear God and sometimes have serious eyebrows. Many things can go on the inside of the food, like stuff that grows from the ground, and other stuff that comes from dead animals. Only one thing goes on the outside of the food: a wrap that you can eat.

I like this wrapped food, and the people who make it, but I think it’s too hard to see why the cool boxes are cool if you try to imagine they are like it. Because if the wrapping has thing one inside, and you want thing two instead, you probably can’t fix it without hurting the food: the inside will get all over you, and you’ll just have to buy a new one.

Tagged , ,