DEV Community

raquelhn
raquelhn

Posted on

Install a Haskell compiler on Macbook with chip M1

Hi everyone!

I struggled with this after getting my new macbook (Apple Silicon (arm64) based macs), the instructions can be very confusing for a newbie so I thought a post would be useful. I followed the instructions of Moritz Angerman @angerman_io

The first step is to open terminal and install rossetta 2:

/usr/sbin/softwareupdate --install-rosetta --agree-to-license

after this, lets install nix

sudo curl -L https://nixos.org/nix/install | sh

then just follow the instructions (you just have to copy a path), and once its installed you can set up a nix compiler, as explained in Moritz tweet, typing this:

nix-shell -p haskell.compiler.ghc882

finally type:

ghci and you should get Prelude>

That is it!! You have haskell, hope it works and helps

Raquel

Top comments (1)

Collapse
 
raquelhn profile image
raquelhn • Edited

I forgot to mention, if you want to access nix again you should save the path the terminal gave you while installing nix, if you forgot try this one
. $HOME/.nix-profile/etc/profile.d/nix.sh