Function Oriented Programming in Haskell
The purpose of this article is to understand Haskell and more importantly, Function Oriented language.
Introduction to Functions and Function Oriented Languages
What is a Function?
A Function
- is a set of executable commands
- accepts zero or more arguments
- returns one and only one result
- doesn’t create any side-effects
What are Higher-Order Functions?
Higher-order functions are functions that can have functions as arguments and also can return functions as results. Functions are treated as First class citizens in a programming language supports higher order functions.
An nth order function means that function can have n-1 functions as it’s arguments
For example, a function that can not have any functions as argument is called 1st order function. Similarly, a function that can have only one functions as argument is called 2nd order function.
What is Function Oriented Programming Paradigm?
Function Oriented Programming paradigm is basically a style of programming using Higher Order Functions and set of concepts that a function oriented language should follow.