So, I wrote a book on functional programming

This is the story of my journey from coder to author. Discover insights, challenges, and triumphs in writing a book on F# programming.

On Saturday August 7, I released a book called Essential Functional-First F# on LeanPub, a self-publishing platform. It is based on two series of blog posts that I've written for the TIMETOACT GROUP blog:

  • Introduction to Functional Programming in F#

  • Introduction to Web Programming in F# with Giraffe

I had a clear picture of what I wanted the first three posts of the Introduction to Functional Programming in F# series to cover. Once these were completed, I wrote a list of what I thought the series should cover over an indeterminate number of posts. I spent a few weeks thinking about how I could best cover everything else on my list and came up with a rough outline for nine further posts. Then came the hard part: Coming up with code samples that show what you want folks to see and little else is very hard. Most of the time spent writing the blog posts was spent coming up with 'perfect' code samples. I tried to make the blog posts similar in size but there is some variation. Even at this stage, I had a plan at the back of my mind to turn the blog posts into a book. 

I don't remember what the trigger was for me to actually start the process but less than three weeks ago, I started to bring the book together.

Tools

My blog posts were written in the limited Markdown that SquareSpace, our blog provider, supports.

The book was written in Markdown using Markdown Monster. It has a text editor and a side by side view of the rendered page. It also now has a spell checker! I did try Visual Studio Code and that works well but Markdown Monster was better for me.

From Blog Posts to Book

I chose to self-publish via LeanPub.com who offered a free option but the web editor is not very functional. I ended up doing a lot of copying and pasting from Markdown Monster to Leanpub.com. On the free version, you are limited to twenty generations of previews or publications per month. They also generate numbers against the lines in the code samples which can only be removed by paying a subscription.

Initial Draft

I copied the Markdown from the blog posts into the editor on Leanpub.com and generated the first preview version of the book. I then spent the next two weeks reworking the code samples so that they all work in Visual Studio Code, fixing any spelling or grammatical errors and adding additional explanations for names and concepts. I initially chose the wrong base format, so the code samples were too big and had too many line wraps. Changing to the Technical format fixed that and reduced the size of the book by twenty-five percent.

Reviewers

I put out a request on Twitter for reviewers and got twelve people. I chose that many because experience tells me that a few will drop out and so it proved. I ended up with six people who were a great help in tidying the book up.

I'm pretty good at spelling and grammar, or so I thought. Getting reviewers to go through the text and the code to find things I'd missed was very useful as they discovered more than I'm happy about! The biggest negative feedback was about the numbering on the code, so I paid my $8.99/month subscription and changed the setting to remove them.

Publishing

Given that it was originally a set of blog posts, I thought that the best approach would be to self-publish for a suitably low price. I also decided that I would donate my author's royalties to the F# Software Foundation as they needed it far more than I did. 

Conclusion

I've ended up producing a book that I'm genuinely proud of. I'm not sure that I could have sat down and just written a book in one go. Breaking it up into a series of steps was probably the only way that this book would have been written.

Blog 11/15/22

5 lessons from running a (remote) design systems book club

Last year I gifted a design systems book I had been reading to a friend and she suggested starting a mini book club so that she’d have some accountability to finish reading the book. I took her up on the offer and so in late spring, our design systems book club was born. But how can you make the meetings fun and engaging even though you're physically separated? Here are a couple of things I learned from running my very first remote book club with my friend!

Blog 12/22/23

ADRs as a Tool to Build Empowered Teams

Learn how we use Architecture Decision Records (ADRs) to build empowered, autonomous teams, enhancing decision-making and collaboration.

Blog 6/24/21

Using a Skill/Will matrix for personal career development

Discover how a Skill/Will Matrix helps employees identify strengths and areas for growth, boosting personal and professional development.

Blog 7/15/21

Building a micro frontend consuming a design system | Part 3

In this blopgpost, you will learn how to create a react application that consumes a design system.

Blog 12/22/22

Introduction to Functional Programming in F# – Part 6

Learn error handling in F# with option types. Improve code reliability using F#'s powerful error-handling techniques.

Blog 12/22/22

Introduction to Functional Programming in F# – Part 7

Explore LINQ and query expressions in F#. Simplify data manipulation and enhance your functional programming skills with this guide.

Blog 5/17/23

Introduction to Functional Programming in F# – Part 10

Discover Agents and Mailboxes in F#. Build responsive applications using these powerful concurrency tools in functional programming.

Blog 3/22/23

Introduction to Functional Programming in F# – Part 9

Explore Active Patterns and Computation Expressions in F#. Enhance code clarity and functionality with these advanced techniques.

Blog 7/12/23

Introduction to Functional Programming in F# – Part 11

Learn type inference and generic functions in F#. Boost efficiency and flexibility in your code with these essential programming concepts.

Blog 8/8/23

Introduction to Functional Programming in F# – Part 12

Explore reflection and meta-programming in F#. Learn how to dynamically manipulate code and enhance flexibility with advanced techniques.

Blog 3/22/23

Introduction to Functional Programming in F# – Part 8

Discover Units of Measure and Type Providers in F#. Enhance data management and type safety in your applications with these powerful tools.

Blog 9/15/22

Introduction to Functional Programming in F# – Part 3

Dive into F# data structures and pattern matching. Simplify code and enhance functionality with these powerful features.

Blog 5/1/21

Ways of Creating Single Case Discriminated Unions in F#

There are quite a few ways of creating single case discriminated unions in F# and this makes them popular for wrapping primitives. In this post, I will go through a number of the approaches that I have seen.

Blog 9/13/22

Introduction to Functional Programming in F# – Part 2

Explore functions, types, and modules in F#. Enhance your skills with practical examples and insights in this detailed guide.

Blog 5/18/22

Introduction to Functional Programming in F#

Dive into functional programming with F# in our introductory series. Learn how to solve real business problems using F#'s functional programming features. This first part covers setting up your environment, basic F# syntax, and implementing a simple use case. Perfect for developers looking to enhance their skills in functional programming.

Blog 10/1/22

Introduction to Functional Programming in F# – Part 4

Unlock F# collections and pipelines. Manage data efficiently and streamline your functional programming workflow with these powerful tools.

Blog 11/30/22

Introduction to Partial Function Application in F#

Partial Function Application is one of the core functional programming concepts that everyone should understand as it is widely used in most F# codebases.In this post I will introduce you to the grace and power of partial application. We will start with tupled arguments that most devs will recognise and then move onto curried arguments that allow us to use partial application.

Blog 10/11/22

Introduction to Functional Programming in F# – Part 5

Master F# asynchronous workflows and parallelism. Enhance application performance with advanced functional programming techniques.

Blog 11/9/23

Process Pipelines

Discover how process pipelines break down complex tasks into manageable steps, optimizing workflows and improving efficiency using Kanban boards.

Blog 7/16/21

Building A Shell Application for Micro Frontends | Part 4

We already have a design system, several micro frontends consuming this design system, and now we need a shell application that imports micro frontends and displays them.