Haskell

programming languages that we learn

Haskell

A Functional Programming language

Haskell is a functional programming language known for its mathematical elegance and strong emphasis on immutability. The language was first developed in the lates of 1980s and is name after the mathematician Haskell Curry. It is a pure functional programming language, which means it relies on mathematical functions and avoids mutable state.

Basic Sintax

  • Variables
let myVar = 42

or

  • Functions
add x y = x + y
  • Comments
-- this is a single-line comment

{- this is a
multi-line 
comment
-}

Pros

  1. Functional Purity
  2. Immutable Data
  3. Strong Typing
  4. Pattern Matching
  5. Laziness

Cons

  1. Steep Learning Curve
  2. Limited Industry Adoption
  3. Performance

Basic hello world

main :: IO ()
main = putStrLn "Hello, World!"
0%