Posts

Showing posts with the label haskell

Introduction to Haskell

What is Haskell? In short Haskell is yet another computer programming language. Haskell is named after Haskell Brooks Curry, a mathematician whose work is a foundation for all functional programming languages. Haskell is a polymorphically statically typed, lazy, purely functional language, way different from other biggies of current programming languages. What is Functional Languages? Haskell is a functional language. F unctional 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 to the imperative programming style, which emphasizes changes in state. Why to Learn Haskell?   Haskell is very different language then currently popular languages like Java, C#, PHP, JavaScript or C++. And switch is very smooth in between these. In my internship I started working on C++ and there only I switched to Java without any learning ...

My 1st Haskell Program

From past few days I was thinking to do something in Haskell. Gone though few blogs and also tried my hands on tryhaskell only Haskell interactive tutorial. It was way different then my bread & butter Java. So wasn't able to understand much. And now was feeling to write a factorial program in Haskell. My first experiment with Haskell.  Downloaded Haskell from here Now Install Haskell similar the way you installed millions of software. Haskell itself update %PATH% variable so you are not ready to rock and roll in Haskell. Haskell comes with ghci, ghc and runhaskell utilities to interpret, compile or run haskell programs. ghci provide haskell prompt where you can execute haskell statements on the fly. ghc is haskell compiler which compile haskell program and produce an exe on successful compilation. runhaskell utility run haskell program on the fly. Below is mine 1st real haskell program Line 1 Prototype of factorial function. Line 2 Body of factorial program...