Open In App

What is Haskell Programming Language?

Last Updated : 02 Mar, 2023
Improve
Improve
Like Article
Like
Save
Share
Report

During the late 1980s as that is, the era of new languages and paradigms were invented. A group of researchers started developing Haskell a purely functional programming language. It was finally published in 1990. It is named based on a U.S. mathematician Haskell Brooks Curry.

Haskell is a modern, standard, purely functional programming and non-strict language. It is Specially designed to handle a wide range of applications, from numerical through to symbolic. It has an expressive syntax and very rich inbuilt architecture.

Haskell is a purely Functional, non-strict Programming Language. It is Specially designed to cope with large-scale industrial production applications. It is known for its rich built architecture. Haskell programs are written as Mathematical functions. 

Features of Haskell:

  • Ease of understanding: Functional programs are easier to understand. There are not imperative or procedural. Functional programs are generally easy to understand but their implementation is difficult.
  • code reuse: Haskell supports polymorphism. For example, the code above not only supports integers but also floating-point numbers, list of characters, List of lists, etc
  • Memory Management: In Language like c, memory Management is done by using the Keyword malloc or calloc, The programmer needs to free the memory after using it. But in functional programming like Haskell programmer is relieved from this burden. Storage is allocated, initialized implicitly, and recovered automatically by the garbage collector.
  • Statically-typed: A statically-typed language is a language where variable types are known at compile time. It helps programmers in identifying errors in compile time. It helps to decrease the complexity of large-scale programs.
  • Purely functional: It is a style of building a program that treats all the computations as mathematical functions.
  • Lazy evaluation: Functional programming like Haskell skips the evaluation of arguments in functions. This increases the performance of the code helping programs compose very well.
  • Type inference: Type inference solves the redundancy of code that explicitly be written to every type of program.
  • Multithreading: Threads are virtual processors handling/processing steps in a program. A Language with a Single thread means at a time only one execution takes place. Haskell is a Multi-threaded language that gives it the ability to do parallel execution of statements in the program. Multi-threading increases the processing power of a programming language’s execution.

Why use Haskell?

Haskell provides various characteristics like:

  • Higher programmer productivity
  • Shorter, cleaner and maintainable code.
  • Higher reliability.
  • Higher Compiling power.

Most of large software products life is spent in design and maintenance as functional programming languages are easier to maintain.

How to run Haskell code?

The Glasgow Haskell Compiler (GHC) is used for running the Haskell code. Its features are:

  • It provides a cross-platform environment.
  • supports numerous extensions, libraries, and optimizations that help the process of generating and executing code.
// Haskell program for print a message 
main :: IO ()                    
main = putStrLn "Hello! Welcome to GeeksforGeeks"

Output:

Functional programming is based on mathematical functions. Some other programming languages that support functional programming paradigm are:  

  • Python
  • Lisp
  • Erlang
  • Racket
  • Closure etc

Like Article
Suggest improvement
Previous
Next
Share your thoughts in the comments

Similar Reads