Haskell Hello World Page


From Wikipedia, the free encyclopedia, the definition of functional
programming paradigm is:

In computer science, functional programming is a programming paradigm
that treats computation as the evaluation of mathematical functions and
avoids state and mutable data. It emphasizes the application of
functions, in contrast with the imperative programming style that
emphasizes changes in state.[1]

First lets start with what you can do like in 2 minutes … personally
that gives me more satisfaction than reading a page of theory and not
seeing it at work.

  1. Download and install GHC from :
    GHC
  2. Run GHC and type this : putStrLn “Hello, world!” (Note: Pay strict
    attention to putStrLn casing, its same as in Java but still.

Voila! your done; but I don’t know i feel bad about working in Consoles, makes me remember those C mixed with Assembly days … :), so here we go! use the below stuff if you are interested in doing stuff in Eclipse.

Prerequisites:

Download and install

: Now for those of you who are working with eclipse, you
use
eclipse for haskell programming. Here’s how :

  1. Go to Help > Software and Updates > Find and Install >
  2. Use new Remote Site, type a Name for remote site, use Haskell,
    Haskell
    Fp
    .

Now that you have Haskell installed on your eclipse, following images :

  1. Step 1:

    New Project

  2. Step 2:

    Enter project Name
  3. Step 3:

    Create a New haskell Module
  4. Step 4:

    Step 4

  5. Step 5:

    Compile using CONTROL + F11 (your plain eclipse compile and run),
    this would create a “theResult.exe”, find the path of it, and run
    this exe file on command prompt and there you go, see for yourself:
    finally the output

Over the course of time, (Expect to see more pages added to Haskell Series above) I will talk about Haskell type system and other things.

Regards Vyas, Anirudh
PS: Can someone tell me how to improve those Ugly images alignment?!