# Solved: addition of two numbers

In the contemporary world, the concept of addition is almost as ubiquitous as the fabric of reality itself. Across multiple domains of human endeavor, the mathematical operation finds countless applications, from basic arithmetic taught in elementary schools to complex computations intrinsic to advanced technological systems. Haskell, a purely functional programming language, significantly simplifies the process of addition with its elegant syntax and high-level abstractions.

The topic of performing addition in Haskell might seem exceedingly straightforward, even trivial, but under the surface lie multiple important considerations and nuances. Let’s delve into it.

## Operations in Haskell and the Primitive Function (+)

Haskell, like any other programming language, offers standard math operations such as addition, subtraction, multiplication, and division. In our case, we are interested in the simplest of those: The addition operation. This is achieved using the primitive function (+) in Haskell.

Operation of addition is performed with the (+) operator. The expression (x + y) adds x and y. Consider this simple Haskell code:

```x = 5
y = 10
sum = x + y
```

Here, we have two integers, 5 and 10, assigned to variables x and y respectively. Then we add these two integers with x + y and store the result in the sum. The value of sum will be 15.

## Step-by-Step Explanation of the Code

Broadly, the code operates in three discrete steps. Let’s break it down for better understanding:

• The first line, ‘x = 5’, declares a variable x and assigns it the value 5.
• The second line does a similar task. It assigns the value 10 to the variable y.
• The third line, ‘sum = x + y’, is where addition operation happens. The (+) operator adds the values stored in x and y, and the result is assigned to the variable sum.

The simplicity and conciseness of Haskell syntax shines brightly here, as the entire operation of addition is encapsulated in a single line of code – ‘sum = x + y’.