Rebuilding a Mac mini

In January 2012, I wanted to learn Apple’s Objective-C programming language, so I bought a basic Mac mini and a book. The Mac was a ‘mid 2011’ model, configured with a 2.3 GHz Intel Core i5 processor, 2 GB of RAM and a 500 GB hard drive. The book was Programming in Objective-C by Stephen G. Kochan.

Fast forward six years and I thought the Mac had bitten the dust. It had become sluggish at best and an upgrade from macOS Sierra to High Sierra version 10.13.3 saw it refuse to boot past the Apple logo screen except through Verbose Mode. However, upgrading the RAM to 4 GB unexpectedly solved the booting problem and gave the Mac a new lease of life. In the interim, I had learned about the Mac’s booting modes and how to make a bootable installer for macOS with a USB drive, erase a hard drive with macOS Utilities and reinstall High Sierra. I now had a working Mac but a clean one and an opportunity to rebuild my environment.

Configuring and enhancing macOS

I re-enabled three-finger dragging of windows and reinstalled the third-party Magnet application to help with the positioning of application windows. Magnet allows windows to snap to areas of the screen like they do in Windows 10.

GitHub Desktop and git

I installed the GitHub Desktop (version 1.1.0 at the time of writing). I also installed the current stable version of git from the git website (version 2.16.2) into its default location at /usr/local/bin. This took precedence on the path over the outdated version at /usr/bin:

Visual Studio Code

I installed Visual Studio (VS) Code and used theĀ Shell Command: Install 'code' command in PATH command in its Command Palette. VS Code is my favourite code editor.

The Haskell Tool Stack

I installed the Haskell Tool Stack. stack setup would then allow me to install versions of the Glasgow Haskell Compiler (GHC) as they are needed.

Configuring Bash

I am using the Terminal application and its default shell, Bash. I created configuration file ~\.bash_profile and, as recommended by the Haskell Tool Stack, added ~\.local\bin to the start of the PATH. I also set the CLICOLOR environment variable (so that the output of the ls command would be in colour) and identified VS Code as the default editor.

Configuring VS Code for Haskell

I installed three extensions for VS Code:

I installed the hlint application using stack install hlint.

Currently, the ghc-mod package (version 5.8.0.0) and its application of the same name cannot be built with versions of GHC after version 8.0.2. If it is built with GHC 8.0.2, it cannot be used with versions after GHC 8.0.2 because it depends on the GHC API. I installed the ghc-mod application using the stack resolver lts-9.21, the most recent one for GHC 8.0.2 at the time of writing. I will disable the Haskell ghc-mod extension in VS Code when using versions of GHC that it does not support.

Xcode

In recent years, I have been more interested in Haskell than Objective-C or Swift (launched in June 2014). However, I reinstalled Xcode through the App Store application.