All Articles

HTMX, WebSockets, SignalR and you

31 Dec 2023
HTMX has gained some recent popularity. Lets explore how we can consume a SignalR Hub from a HTMX application.
This year's entry to Sergey Tihon's F# advent calendar. Thanks again :)

F# in strange places: Supabase edge functions

31 Dec 2022
With the rising interest in WebAssembly, can we compile F# to WebAssembly, but then use it from a Supabase edge function?
This is my entry for the F# Advent Calendar 2022. Thank you Sergey Tihon for organizing it.

Using Sutil to develop a real world application

31 Dec 2021
Testing out a new web framework is always difficult unless you spend some time with it building a real world application. This post explores doing just that by using Sutil to develop an application called Conduit as part of the Real World project to compare frontend and backend frameworks.
This is my entry for the F# Advent Calendar 2021. Thank you Sergey Tihon for organizing it. This post will explore building a small demo application using the Sutil framework. See the final result here.

Type safe SQL Queries using Rezoom.SQL

15 Dec 2019
Introduction to Rezoom.SQL. A F# Type Provider that generates types from migration scripts, instead of a remote resource.
This is my F# Advent Calendar 2019 entry. Last year I wrote about Fable React and Preact, but this year I want to write about data access, a topic that practically any application requires. Considering F# is a .Net language, any of the large amount of ORMs available to C# are also available to F#. The big problem, of course, is that they are generally OOP oriented and not not very idiomatic F#. Now, of course you could argue that, because F# is multi-paradigm, it's not actually a problem switching to OOP, but where would the fun be in that?

Fable React is nice. But what about Fable Preact

31 Dec 2018
Reducing final bundle size of a Fable-React application by using Preact instead.
This is my entry for the F# Advent Calendar 2018. I’ve been doing full-stack .Net web development for ~6 years now, and I learned F# ~3 years ago. In the second set of 3 years, I’ve also done more frontend web development than I did backend. In this time I’ve had the (mis)fortune of playing with countless JS SPA frameworks. This has given me the insight into what these various frameworks do, how they work, and how they differ from the other frameworks. I’ve also thought about what web developers should be paying more attention to, and what is nice and fun. In this post I want to explore a combination of what’s fun (Fable Elmish), and what I believe developers need to pay more attention to (bundle size). With that, I’d like to delve into two topics, namely, what I believe to be a big problem with the current state of web development, and a possible solution to this problem.

Recursive Async

15 Nov 2018
More involved take on recursion. How to properly type recursion when async is involved.
There was recently a project I was working on that required a recursive call. The problem was, that the function returned an async workflow, and in my inexperience, I was running into the problem that I didn’t know what each exit point should return exactly. This is a problem, because in F# all code paths must return the same type, and I wasn’t sure when I needed to wait for an async call, or return the async workflow itself. The idea behind the function was that it would query the database for a specific string, and if it didn’t find anything, it would shorten the string and try again, until the string was a certain length. After some looking around online, I came across this FSSnip that describes a recusive async function: