Saturday, July 30, 2011

Haskell_Notes_1

1. Learning Haskell is like learning programming from Zero.  Wow, I can learn programming, without any pre-conceptions. I am in LKG, which I never studied. In fact in my college time also did not learn a programming language, the way it should have been learnt. It's great to have another chance now.

2. A programming language should affect your thinking. It should change the way you think. After leaning a programming language, I should be something new. http://norvig.com/21-days.html

Notes from LearnYouAHaskell
------------------------------------
1. Imperative Programming
2. Functional Programming
3. Haskell is great and if you're interested in programming you should really learn it even if it seems weird at first. Learning Haskell is much like learning to program for the first time — it's fun! It forces you to think differently
4. Purely Functional Programming Language
         --A function has no side effect: It does not change any of the existing thing/object/item. It does calculation using existing objects and returns the result. (like Utility static functions which gets primitive types as parameters.)
         --Referential Transparency - A function, can be called "N" number of times, with same parameters, output is always same. (Predictability/Consistency?)
          --A type(variable) in the system can be set only once. It cannot be changed. --Immutable.
          -- LAZY - Does everything only at the neck of the moment. Never does anything proactively.  How come we are using this language :) we want everything & everyone to be proactive, hyperactive whatever new terms come up :)   doubleMe(doubleMe(doubleMe(listIntegers)));  it does not do anything when this statement is executed.   When you want to see the actual result, it executes.
 3. Statically Typed - Good Type Inference system - compiler should be able to catch all the type related issues.
 4.  Elegant and Concise - A function should be of 3 to 5 lines - very short and crisp. -- this is applicable for any language.
---------------------------
Environment:


1. Programming Language: Haskell
2. IDE - Notepad++ or any text editor you like
3. Compiler - GHC - Glasgow Haskell Compiler - this comes with an interpreter: ghci
4. File extension: myFunctions.hs
5. to load/reload the functions in the interpreter: :l myFunction
6. to reload after onetime loading - :r       ---- Reloads the current script.





No comments:

Post a Comment