Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Setting up Haskell in your machine

Step 1: Download Haskell from following location.

Step 2: Run the installer

Step 3: You have to add the Haskell bin directory path to your system path.  If you are using Mac (or) any linux system, open terminal and type ‘ghci’ command, if you are using Windows, you should go to All Programs, then GHC; you will see Ghci in the list. When you run the command ghci, it opens window like below, starting with version of GHCi followed by Prelude prompt. Prelude is a standard library of GHCi, that provides very useful functions.

$ ghci
GHCi, version 7.10.3: :? for help

‘ghci’ command opens Haskell in interactive mode, you can use this interactive session for learning/experiment purpose.

Prelude> 1+2
Prelude> 1-2
Prelude> 1/2
Prelude> 1*2

If you load other libraries, then Prelude prompt changes to new library.

Prelude> import Data.List
Prelude Data.List>

GHC (Glasgow Haskell Compiler) has following three core components.
Compiler generates native code.
It is an interactive interpreter and debugger.
It is a program used to Haskell programs as scripts.

Prelude is the core library loaded by default in every Haskell program.

This post first appeared on Java Tutorial : Blog To Learn Java Programming, please read the originial post: here

Share the post

Setting up Haskell in your machine


Subscribe to Java Tutorial : Blog To Learn Java Programming

Get updates delivered right to your inbox!

Thank you for your subscription