Haskell - Decision Making


Decision Making is a feature that allows the programmers to apply a condition in the code flow. The programmer can execute a set of instructions depending on a predefined condition. The following flowchart shows the decision-making structure of Haskell −

Condition Loop

Haskell provides the following types of decision-making statements −

Sr.No. Statement & Description
1 if–else statement

One if statement with an else statement. The instruction in the else block will execute only when the given Boolean condition fails to satisfy.

2 Nested if-else statement

Multiple if blocks followed by else blocks