Introduction to Functional Programming [Part 2]

Think Functional

Posted by Nivin Anton Alexis Lawrence on August 23, 2019

You may find interesting:


Introduction to Functional Programming [Part 1]

Think Functional

Partial Application

In Haskell, we can call a function with fewer number of arguments than the formal definition. i.e. say the function formally takes three arguments, you can still invoke the function with just one or two arguments.

 add  :: Int -> Int -> Int 
 add x y = x + y
 
 addPlusTen = add 10

Note: Not to be confused with partial function or total function. Partial function by mathematical definition is written as

Curried Function

Type Classes

Functor

Applicative

Monad

(Pattern Matching, Guards and Conditional Definitions)

Higher Order Functions

Kleisli Categories

(Functions, Monoids and Monads)