There are some platform-specific notes on the reflex-platform page that imply that things might be broken on Arch Linux and things might need some tweaking on Linux Mint.

I’ve also had to fiddle around to get Nix working on OS X in the past, but runing try-reflex and adding the binary caches worked for me when I tried it. I have vague memories of using homebrew to install things that were missing from the host environment when I last had trouble, so that might be a useful thing to try. Let me know if you have problems and I’ll try to find a way to help.

Binary cache setup

You probably want to get hold of some of the dependencies in binary form, rather than getting hold of them in source form and building them. It’ll save you a lot of time.

If you’re on NixOS, you can add the reflex binary caches by adding the following to /etc/nixos/configuration.nix:

Poking around with the first exercise

There is a script in here for each of the exercises (and more will be added as the series continues).

For now, run:

nix-shell> ./ex00.sh

from the exercises directory and then visit http://localhost:9090 in your browser (although there is currently a bug in jsaddle-warp affecting Firefox).

This script is running ghcid along with some magic to trigger a reload in the browser tab when the Haskell or CSS files change. Depending on your browser, you might need to either run in private browsing mode or do a hard reload in order to get the CSS to update.

You should open these files in an editor and tinker with the strings in the Haskell program and the color in the CSS class.

After you save you’ll either get errors in the terminal running the ex00.sh script or the browser tab will reload with the new content.

Click around in the browser tab after each save to convince yourself that this is happening.

This is still fairly new technology, I’m new to using it, and I’m not sure if what I’m doing behind the scenes counts as abusing the technology. For any of the above reasons, you might have to restart the script or manually reload the tab from time to time. I’ll try to make this more reliable over time.

There might be some worrying looking output in the terminal that is running the script, along the lines of threadWait: invalid argument (Bad file descriptor) or ConnectionClosed, but those messages usually won’t cause trouble.

The goal

The goal of this exercise was to get you comfortable with the workflow, but some people might need more than that to feel a sense of accomplishment.

If that’s the case then I’m happy to accommodate you: your new goal is to edit the above files and to try to end up in a state where you have something in your browser that behaves like this: