FP Complete

The Pains of Path Parsing

I’ve spent a considerable amount of coding time getting into the weeds of path parsing and generation in web applications. First with Yesod in Haskell, and more recently with a side project for routetypes in Rust. (Side note: I’ll likely do some blogging and/or videos about that project in the future, stay tuned.) My recent […]

Captures in closures and async blocks

This blog post is the second in the Rust quickies series. In my training sessions, we often come up with quick examples to demonstrate some point. Instead of forgetting about them, I want to put short blog posts together focusing on these examples. Hopefully these will be helpful, enjoy! FP Complete is looking for Rust […]

Short Circuit Sum in Rust

This blog post is the first in a planned series I’m calling “Rust quickies.” In my training sessions, we often come up with quick examples to demonstrate some point. Instead of forgetting about them, I want to put short blog posts together focusing on these examples. Hopefully these will be helpful, enjoy! FP Complete is […]

Philosophies of Rust and Haskell

Rust is a systems programming language following fairly standard imperative approaches and a C-style syntax. Haskell is a purely functional programming language, innovating in areas such as type theory and effect management. Viewed that way, these languages are polar opposites. And yet, these two languages attract many of the same people, including the engineering team […]

Cloning a reference and method call syntax in Rust

This semi-surprising corner case came up in some recent Rust training I was giving. I figured a short write-up may help some others in the future. Rust’s language design focuses on ergonomics. The goal is to make common patterns easy to write on a regular basis. This overall works out very well. But occasionally, you […]

Pattern matching

I first started writing Haskell about 15 years ago. My learning curve for the language was haphazard at best. In many cases, I learnt concepts by osmosis, and only later learned the proper terminology and details around them. One of the prime examples of this is pattern matching. Using a case expression in Haskell, or […]

Monads and GATs in nightly Rust

This blog post was entirely inspired by reading the GATs on Nightly! Reddit post by /u/C5H5N5O. I just decided to take things a little bit too far, and thought a blog post on it would be fun. I want to be clear from the start: I’m introducing some advanced concepts in this post that rely […]

Error handling is hard

This blog post will use mostly Rust and Haskell code snippets to demonstrate its points. But I don’t believe the core point is language-specific at all. Here’s a bit of Rust code to read the contents of input.txt and print it to stdout. What’s wrong with it? fn main() { let s = std::fs::read_to_string(“input.txt”).unwrap(); println!(“{}”, […]

An ownership puzzle with Rust, async, and hyper

Most of the web services I’ve written in Rust have used actix-web. Recently, I needed to write something that will provide some reverse proxy functionality. I’m more familiar with the hyper-powered HTTP client libraries (reqwest in particular). I decided this would be a good time to experiment again with hyper on the server side as […]

Deploying Rust with Windows Containers on Kubernetes

A few years back, we published a blog post about deploying a Rust application using Docker and Kubernetes. That application was a Telegram bot. We’re going to do something similar today, but with a few meaningful differences: We’re going to be deploying a web app. Don’t get too excited: this will be an incredibly simply […]