Self-publishing my first book

It all started in 2013, when one of my former coworkers told me about this weird mathematical programming language called Haskell. I already had an interest in mathematics, so it didn’t take long before I started looking into it. I visited the awesome community on Freenode and was suggested to read Learn You a Haskell for Great Good.

I was amazed by both the book and the language. I started to blog about the things I learned. Algebraic data types eventually turned out to be my bachelor thesis in 2015. As the number of blog posts kept increasing, I thought of writing a book on dependent types. I collected all the blog posts, edited them, put them in a logical order and asked some friends to review the chapters. Finally, in September 2018 I self-published my first book, Gentle Introduction to Dependent Types with Idris.

My book has exceeded the sales expectations I had. I didn’t do any paid marketing at all. The only marketing was maybe doing a few posts on social media. It was a great experience for me, my writing skills improved, and I learned a lot about books, reading, and writing, receiving feedback.

Here’s a summary of what I’ve learned during the process:

  1. Receive feedback as early as possible – what makes sense to you does not necessarily make sense to all readers. I found reviewers by pinging some friends and googling for bloggers interested in the same topic. Reviewers’ feedback is very valuable. It is important to keep low ego and revise parts that really suck, but it needs to work both ways – reviewers must be providing constructive criticism
  2. Writing a book is harder than blogging (it requires logical flow, every paragraph needs to have context similar to previous, etc). Putting thoughts randomly on a blog is OK but a book has to have a kind of structure. Writing, in general, is hard and requires a lot of patience
  3. I didn’t know everything when I started writing the book – only some parts. I found it’s interesting and fun to learn as you go – you eventually become an “expert” in the field
  4. Grammar – keep simple statements, active voice, paragraphs, etc
  5. Continuously read and revise

For the writing process, I started copying and pasting my blog contents to a Google Drive document and shared it with the reviewers. After a while, I found out about Leanpub, and moved all of the content to a GitHub repository using Leanpub’s extended Markdown which also supports LaTeX. Reviewers would then either create GitHub issues or pull requests. Leanpub allows you to export your book as a pdf/mobi/epub format. It also allows exporting of a so-called “print book” format, so I could build my book with a few clicks and upload it to Amazon’s Kindle Direct Publishing service. I also used Grammarly and aspell.

It was interesting to me how writing a book in today’s age is very simple with all the tools that are available to us.

I’m thankful to my family, the reviewers, my former and current coworkers, and everybody else directly or indirectly involved.

One thought on “Self-publishing my first book

Leave a comment