Slide 1

Slide 1 text

Quadri Atharu WITH LET AND LAMBDA FUNCTIONS

Slide 2

Slide 2 text

INTRODUCTION TO FUNCTIONAL PROGRAMMING Functional programming is a programming paradigm that treats computation as the evaluation of mathematical functions and avoids changing-state and mutable data. It is a declarative type of programming that focuses on “what to solve” rather that “how to solve”

Slide 3

Slide 3 text

FUNCTIONS

Slide 4

Slide 4 text

TYPES OF FUNCTIONS Built-in functions User-defined or Custom functions (UDFs)

Slide 5

Slide 5 text

LAMBDA CALCULUS (ʎ-CALCULUS)  Lambda calculus is a foundation for functional programming languages, as it provides a simple and powerful way to express computations. It is also used in the study of computability and formal logic.  It is a mathematical model of computation based on the concept of functions and variables. Lambda calculus uses lambda expressions to represent functions and their arguments.  It was developed by mathematician Alonzo Church in the 1930s before advent of electronic computers.  It has been a feature of numerous programming languages since Lisp in 1958.

Slide 6

Slide 6 text

LAMBDA FUNCTION The LAMBDA function enables you to create custom reusable functions in Excel. It allows you to encapsulate complex logic, making your spreadsheets more modular and easier to maintain. It takes in a list of parameters and a lambda expression that defines how the function behaves. Here's an example: =LAMBDA(parameter_or_calculation,parameter_or_calculation..) =LAMBDA(x, y, x^2 + y^2)

Slide 7

Slide 7 text

The LET function in Excel allows you to define variables within a formula. It enhances formula readability and performance by breaking down complex calculations into smaller, more manageable steps.

Slide 8

Slide 8 text

Modularity: FP promotes modularity by breaking down programs into smaller, reusable functions. This makes it easier to understand, test, and maintain code. Immutability: In functional programming, variables are immutable, meaning it cannot be changed once created. This eliminates the risk of unexpected side effects and makes programs more reliable and easier to reason about. Lazy Evaluation: It avoids repeated evaluation as value is evaluated and stored only when it’s needed.