English 中文(简体)
Haskell - Environment Set Up
  • 时间:2024-12-22

Haskell - Environment Set Up


Previous Page Next Page  

We have set up the Haskell programing environment onpne at − https://www.tutorialspoint.com/compile_haskell_onpne.php

This onpne editor has plenty of options to practice Haskell programing examples. Go to the terminal section of the page and type "ghci". This command automatically loads Haskell compiler and starts Haskell onpne. 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...pnking...done.
Loading packageinteger gmp...pnking... done.
Loading package base...pnking...done.
Prelude>

If you still want to use Haskell offpne 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 Apppcations 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 apppcation 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 pke 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.

Windows Installer

Check out your system’s architecture and download the corresponding setup file and run it. It will install pke any other Windows apppcation. 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.

MAC Installer

Environment Set Up in Linux

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

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/pnux.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.

Ubuntu Installer

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 instalpng, 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.

Local System

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

Advertisements