Skip to content

Instantly share code, notes, and snippets.

View mtesseract's full-sized avatar

Moritz Clasmeier mtesseract

View GitHub Profile
@mtesseract
mtesseract / deploying-reflex-nixos.md
Last active October 5, 2023 21:25
Deploying a Reflex Application to NixOS

Deploying a Reflex Application to NixOS

In the following post I describe how a simple Haskell web application built on top of Reflex FRP can be deployed to a remote NixOS server. If a remote NixOS server is available using it for deployment can be cheaper alternative to commercial cloud providers in case the features of those (e.g. scaling, hosted services, availability guarantees, etc.) are not strictly required.

The sample Reflex application can be found on GitHub.

Our setting is as follows:

  • The application, consisting of a frontend and a backend, is built with Nix
  • The development system is a Mac (i.e., not x86_64-linux)
@mtesseract
mtesseract / haskell-records.md
Last active March 8, 2023 22:25
Working around Haskell's namespace problem for records

The Problem

Defining records in Haskell causes accessor functions for the record's fields to be defined. There is no seperate namespace for these accessor functions.

The Goal

Be able to

  • use records in Haskell, which share field names.
  • use lenses for accessing these fields