Using Tagged to write safer Swift code

A guy hidden in a repository costume

I recently started a tiny side project that implements the Beanstalk protocol. If you’ve never heard of beanstalkd, it’s a work queue that’s really convenient for simple projects: you post jobs to queues and those jobs are picked up and handled by workers. Each job that you post to a queue has a priority that goes from 0 (urgent) to 4,294,967,295 (not so much). In Swift, this can be represented with a UInt32, but let’s see how we can use Tagged to make it safer and more expressive, starting with an example from a real-world codebase.

Continue reading

Collective Effort

People sending +1 messages to a github issue

It has been three and a half year that I get the occasional notification from GitHub, about someone asking Facebook to add Swift Support to Infer. They grow up so fast!

Using a custom editor with Git

I already mentioned this tiny side project that I’ve been playing with a couple of time before. I learned a lot while working on it, so I realized I could share some of this knowledge around here. Let’s start with customizing the editor to use to write a commit message. This is probably obvious, but most of this blog post will talk about running git commands from your shell. If you’re not a command line user and prefer using some tool like Fork or Tower don’t be scared, it should be quite easy to follow.

Continue reading