These instructions have been tested on Windows 10 and Windows 11.

Anti-virus software may interfere with the installation process. If you run into errors during the install, you can try temporarily disabling your anti-virus software.

If you experience problems during the installation process, you can go to a drop-in consultation session or ask for help on Ed.

Uninstall instructions (only if you have previously installed Haskell)

Note that there are many ways to install GHC, and therefore it is impossible for these uninstall instructions to work on all possible ways that GHC may have been installed. If you are having trouble removing a previous Haskell installation from your computer, please ask a tutor to help you uninstall Haskell from your machine before proceeding with the installation.

  1. Check your desktop folder for a file called Uninstall Haskell.ps1.
  2. If the file in step 1 exists, right click on it and select “Run with PowerShell”.
  3. Open C:\ in File Explorer and delete these folders if they exist: ghcup, cabal.

Installing Haskell

Windows Defender anti-virus may interfere with the installation process. If you run into errors during the install, you can try temporarily disabling Defender.

If you are installing from overseas, you may need to connect to a VPN for the installation to work.

  1. Open a Windows PowerShell console.

    1-win

  2. Copy the following command and paste it into the PowerShell console. It is a pretty long command, so before copying the command, make sure you have selected all of it. Pro tip: you can do this by triple clicking on this particular command.

    Start-Transcript -Append ([Environment]::GetFolderPath("Desktop") + "\HaskellInstallLog.txt");$ExistingHaskellErrMsg = "Existing Haskell installation detected... aborting installation";try {ghc; gcm ghc; Write-Host $ExistingHaskellErrMsg -ForegroundColor Red; Stop-Transcript; Return} catch {};try {cabal; gcm cabal; Write-Host $ExistingHaskellErrMsg -ForegroundColor Red; Stop-Transcript; Return} catch {};if ((Get-CimInstance win32_logicaldisk)[0]."FreeSpace" -lt 5368709120) {Write-Host "Not enough space on C: drive (need at least 5GB)... aborting installation" -ForegroundColor Red; Stop-Transcript; Return};$WorkingDir = (Get-Location).Path;cd C:\;Set-ExecutionPolicy Bypass -Scope Process -Force;[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072;Invoke-Command -ScriptBlock ([ScriptBlock]::Create((Invoke-WebRequest https://www.haskell.org/ghcup/sh/bootstrap-haskell.ps1 -UseBasicParsing))) -ArgumentList $false,$true,$true,$false,$false,$false,$false;$env:Path += ";C:\ghcup\bin";ghcup install ghc 9.2.5 --set;ghcup install cabal;$PathToAdd = ";C:\ghcup\msys64\usr\bin;C:\cabal\bin";$UserPath = [Environment]::GetEnvironmentVariables("User")::Path;[Environment]::SetEnvironmentVariable("Path", $UserPath + $PathToAdd, "User");$env:Path += $PathToAdd;$env:CABAL_DIR = "C:\cabal";cabal update;cabal install --lib codeworld-api-0.8.0;cabal install doctest;Write-Host "Haskell installation has finished!" -ForegroundColor Green;Stop-Transcript;cd $WorkingDir
    

    If you’re curious about what this command does, see here for an explanation.

    win-script-launch

    Once you have pasted the command into PowerShell, then press enter to run the command and install Haskell. This command will take quite some time to complete.

    If you are installing GHC from overseas, you may run into an error relating to ghcup-0.0.7.yaml. If this is the case, try running the following command, and then try the command above once again.

    Invoke-WebRequest https://comp.anu.edu.au/courses/comp1100/assets/ghcup-0.0.7.yaml -OutFile C:\ghcup\cache\ghcup-0.0.7.yaml
    

    If you run into problems during the installation process, you can ask a tutor for help. There should be a file called HaskellInstallLog.txt on your desktop. You should give this file to the tutors when seeking help as it will help them figure out what has gone wrong. Once the installation completes successfully, you may delete this file.

    There will also be a file called Uninstall Haskell.ps1 on your desktop. You can use this to uninstall Haskell at a later date (after the course) if you wish.

    After a while, the PowerShell console should look something like this…

    win-script-completed

Congratulations! Your Haskell installation should now be ready to go.

VSCode Setup

If you haven’t installed VSCode, you can download it from https://code.visualstudio.com

After installing VSCode…

  1. Launch VSCode.
  2. Select “File > Preferences > Extensions”, search for haskell and install the “Haskell Syntax Highlighting” extension by clicking the Install button.
    haskell-syntax-highlighting
  3. Enable the “Auto Save” feature by clicking “File > Auto Save”. autosave

Installing Git

You can download Git from https://git-scm.com/download/.

bars search times arrow-up