DEV Community

Gishan Chaminga Abeysinghe
Gishan Chaminga Abeysinghe

Posted on

Haskell - part 1 - Introduction

When I was doing my master's I learned an alienated programming language. subject name was functional programming. As I am a programming languages enthusiast I just chose the subject without knowing how its gonna be. though I heard its all about a language called Haskell I really didnt bother much to search about it.

So lets come to the Intro.

Haskell is a functional programming language. what? yeah all the other languages also have functions. whats new in here then.

So in haskell everything is a pure function.

okay. what is a pure function?

  • It always gives you the same output when you provide same input.
  • No side effects.

What are side effects then.

  • A side effects are when a function relies on, or modifies, something outside its parameters to do something.

I copied the definition. Anyways I can give you some examples. If you do an API call, IO operation, database calls or even console logs these thing are called as side effects.

So now you might get a doubt on how we can do those side effects.

Actually in Haskell there is a concept called "Monads" to handle it. In a coming blog i will explain how to write a monad. As it has a more learning curve.

This is just a small introduction. will meet the next blog soon. till then enjoy coding.


Discussion (1)

hexcube profile image
Rohan "HEXcube" Villoth

I remember taking your help for functional programming assignments of our masters. Looking forward to next blog. 👍🏼