Friday, July 6, 2012

Haskell

Haskell is an advanced purely-functional programming language. An open-source product of more than twenty years of cutting-edge research, it allows rapid development of robust, concise, correct software. With strong support for integration with other languages, built-in concurrency and parallelism, debuggers, profilers, rich libraries and an active community, Haskell makes it easier to produce flexible, maintainable, high-quality software.

Advantages :
1) Highly capable of concurrent programs
2) Has a very strong community
3) Very concise syntax
4) High performance in general (but still not better than C/C++)
5) No unnecessary parentheses
6) Very modular

Disadvantages :
1) Moderately easy to learn, pretty hard to master
2) Quite complicated at the start
3) No IDE that is good enough... yet. There are existing IDEs, but according to Haskel programmers, there is still no IDE that is good enough for Haskell the way that Eclipse is perfect for Java development.

Sample Hello World Haskell program:

main = putStrLn "Hello World!"

Sample recursive program (factorial) :


factorial 0 = 1
factorial n = n * factorial (n-1)


Then, after importing the following Haskell code, or entering it in the interpreter, you can use it like this :


factorial 10


Haskell has a powerful list comprehension and it allows infinite lists.
Here is an example of how Haskell comprehends on lists:

"Iterate through the list of 1, 2, 3, etc. For each value, put that into x and then evaluate the expression x * 2. Take each evaluation and build a list of that". The result being that list from 2 to 12.

Sample code in printing a string which is inputed by the user.

module Main where

main :: IO ()
main = do putStr "You are? "
          name <- getLine
          greet name

greet :: String -> IO ()
greet name = putStrLn $ greeting name

greeting :: String -> String
greeting name = "Hello, " ++ name ++ "!"


This program ask the user for its name, by asking a prompt "You are?", then when the user input a string that will be store in variable name, the it will be print "Hello <the string inputed>!"

Review/Comment:

“ Programmers are hungry to learn more about the foundations of functional programming. The purely functional language Haskell is the best medium to teach those fundamentals.” ― Erik Meijer

“A wonderful introduction to functional programming in Haskell. I'm using it as part of an undergraduate course and I'm amazed at how fast my students have understood issues with which previous classes of mine have struggled. In my opinion, this is the best introductory text available on functional programming in any language.” ― Bill Harrison

“An excellent introduction to functional programming in Haskell, written by a first-rate teacher and researcher. The material is presented in an engaging, light and no-frills style, at a pace that is appropriate for undergraduates even in their first year. I thoroughly recommend it.” ― Richard Bird

“By far the best introduction to Haskell I've seen. It's great to read a really clear, concise text book, I could almost feel my brain re-organising itself while I read it. The experience reminded me of reading Kernighan & Ritchie after some months of confused C hacking, feeling everything clicking into place.” ― Alex McLean

“Among the most elegant computer language books I've read, and it will go on my shelf next to The Little Schemer and Godel, Escher, Bach. The text presented an enlightening and well explained new concept in typed functional programming on nearly every page.” ― Braddock Gaskill

“ Once in a while you come across a book which makes reading a pleasure. You don't feel like doing anything else apart from reading the book. Programming in Haskell is one such book. Reading the book gives you a wow feeling. Haskell to me never felt easy before” ― Chandrasekhar Prabala

“ A very clear introduction to the essentials of Haskell. If I had to pick one book to recommend, for newcomers or old hands, this would be the one.” ― B. Wise

“The material is very well written, concise and easy to understand. I'd recommend this text to anyone starting out with Haskell.” ― Joey Capper

“I wish I had such a book for every new language I want to learn. I cannot recommend this book highly enough.” ― T. Herchenröders

“An incredibly clear and concise introduction to the basic features and modus operandi of Haskell.” ― K. Snavely
“Contains absolutely everything that the beginner needs to know.” ― Daniel Lewis

“Well written, clear, concise, and easy to follow” ― Davis

“The writing style is clear and to the point” ― Mark Twain

“This looks like the introductory Haskell text!” ― Paul Potts

“Absolutely Excellent” ― Benjamin Manes



-Source(s):
> http://www.haskell.org/haskellwiki/Haskell
>http://vvv.tobiassjosten.net/haskell/haskell-list-comprehension-to-color-states
>http://www.cs.nott.ac.uk/~gmh/book.html

Members:
Bautista, Arby Lyra   2010-42033
Caleon, Arvin   2010-14000
Ferrer, Sherwin Jet   2010-41794
Gabriel, Mark Angelo   2010-42992
Lagrimas, Raven   2010-43168

No comments:

Post a Comment