Haskell – Environment Set Up

  • Post author:
  • Post category:Haskell
  • Post comments:1 Comment
Haskell - Environment Set Up

This topic is about Haskell – Environment Set Up.

The online editor has plenty of options to practice Haskell programing examples. The “ghci” command automatically loads Haskell compiler and starts Haskell online. You will receive the following output after using the ghci command.

sh-4.3$ ghci
GHCi,version7.8.4:http://www.haskell.org/ghc/:?forhelp
Loading package ghc-prim...linking...done.
Loading packageinteger gmp...linking... done.
Loading package base...linking...done.
Prelude>

If you still want to use Haskell offline in your local system, then you need to download the available Haskell setup from its official webpage βˆ’ https://www.haskell.org/downloads

There are three different types of installers available in the market βˆ’

  • Minimal Installer βˆ’ It provides GHC (The Glasgow Haskell Compiler), CABAL (Common Architecture for Building Applications and Libraries), and Stack tools.
  • Stack Installer βˆ’ In this installer, the GHC can be downloaded in a cross-platform of managed toll chain. It will install your application globally such that it can update its API tools whenever required. It automatically resolves all the Haskell-oriented dependencies.
  • Haskell Platform βˆ’ This is the best way to install Haskell because it will install the entire platform in your machine and that to from one specific location. This installer is not distributive like the above two installers.

We have seen different types of installer available in market now let us see how to use those installers in our machine. In this tutorial we are going to use Haskell platform installer to install Haskell compiler in our system.

Environment Set Up in Windows

To set up Haskell environment on your Windows computer, go to their official website https://www.haskell.org/platform/windows.html and download the Installer according to your customizable architecture.

Check out your system’s architecture and download the corresponding setup file and run it. It will install like any other Windows application. You may need to update the CABAL configuration of your system.

Environment Set Up in MAC

To set up Haskell environment on your MAC system, go to their official website https://www.haskell.org/platform/mac.html and download the Mac installer.

Environment Set Up in Linux

Installing Haskell on a Linux-based system requires to run some command which is not that much easy like MAC and Windows. Yes, it is tiresome but it is reliable.

You can follow the steps given below to install Haskell on your Linux system βˆ’

Step 1 βˆ’ To set up Haskell environment on your Linux system, go to the official website https://www.haskell.org/platform/linux.html and choose your distribution. You will find the following screen on your browser.

Linux Installer

Step 2 βˆ’ Select your Distribution. In our case, we are using Ubuntu. After selecting this option, you will get the following page on your screen with the command to install the Haskell in our local system.

Step 3 βˆ’ Open a terminal by pressing Ctrl + Alt + T. Run the command “$ sudo apt-get install haskell-platform” and press Enter. It will automatically start downloading Haskell on your system after authenticating you with the root password. After installing, you will receive a confirmation message.

Step 4 βˆ’ Go to your terminal again and run the GHCI command. Once you get the Prelude prompt, you are ready to use Haskell on your local system.

To exit from the GHCI prolog, you can use the command “:quit exit”.

In this topic we learned about Haskell – Environment Set Up. To know more, Click Here.

This Post Has One Comment

Leave a Reply