Here's the latest instructions for how to install Hugs 98 on macOS. All the other documentation I could find was regarding installing the full Haskell platform and GHC, so if all you want is Hugs 98 for a university module, here's how to get it. You'll need to open Terminal to run these commands (and to use Hugs), which is in /Applications/Utilities
.
Install Homebrew if you don't have it already. Run the following in Terminal, and follow the steps as prompted.
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Install Hugs 98. Make sure Homebrew installed successfully, then run the following:
brew install FranklinChen/tap/hugs --HEAD
That's it! Once the command finishes running, you can start using Hugs by running hugs
from Terminal.
$ hugs
__ __ __ __ ____ ___ _________________________________________
|| || || || || || ||__ Hugs 98: Based on the Haskell 98 standard
||___|| ||__|| ||__|| __|| Copyright (c) 1994-2005
||---|| ___|| World Wide Web: http://haskell.org/hugs
|| || Bugs: http://hackage.haskell.org/trac/hugs
|| || Version: September 2006 _________________________________________
Haskell 98 mode: Restart with command line option -98 to enable extensions
Type :?
for help
Hugs>
The installation of Hugs may take some time, as it has to build it on your machine rather than just pouring it. Here's the expected output from the above command so you can make sure it installed successfully.
$ brew install FranklinChen/tap/hugs --HEAD ==> Tapping franklinchen/tap Cloning into '/usr/local/Homebrew/Library/Taps/franklinchen/homebrew-tap'... remote: Counting objects: 6, done. remote: Compressing objects: 100% (6/6), done. remote: Total 6 (delta 0), reused 6 (delta 0), pack-reused 0 Unpacking objects: 100% (6/6), done. Tapped 2 formulae (31 files, 23K) ==> Installing hugs from franklinchen/tap ==> Installing dependencies for franklinchen/tap/hugs: readline ==> Installing franklinchen/tap/hugs dependency: readline ==> Downloading https://homebrew.bintray.com/bottles/readline-7.0.sierra.bottle. ######################################################################## 100.0% ==> Pouring readline-7.0.sierra.bottle.tar.gz ==> Caveats This formula is keg-only, which means it was not symlinked into /usr/local. macOS provides the BSD libedit library, which shadows libreadline. In order to prevent conflicts when programs look for libreadline we are defaulting this GNU Readline installation to keg-only. Generally there are no consequences of this for you. If you build your own software and it requires this formula, you'll need to add to your build variables: LDFLAGS: -L/usr/local/opt/readline/lib CPPFLAGS: -I/usr/local/opt/readline/include ==> Summary 🍺 /usr/local/Cellar/readline/7.0: 45 files, 2M ==> Installing franklinchen/tap/hugs ==> Cloning https://github.com/FranklinChen/hugs98-plus-Sep2006.git Cloning into '/Users/grgarside/Library/Caches/Homebrew/hugs--git'... remote: Counting objects: 5852, done. remote: Compressing objects: 100% (4726/4726), done. remote: Total 5852 (delta 441), reused 5781 (delta 430), pack-reused 0 Receiving objects: 100% (5852/5852), 5.29 MiB | 1.15 MiB/s, done. Resolving deltas: 100% (441/441), done. Checking connectivity... done. ==> Checking out branch master ==> ./configure --prefix=/usr/local/Cellar/hugs/HEAD-86e2342 ==> make ==> make install 🍺 /usr/local/Cellar/hugs/HEAD-86e2342: 909 files, 8.0M, built in 6 minutes 13 seconds
I am getting this "FATAL ERROR: Unable to load prelude implementation", but it do loads hugs