# Currying

*A brief intro to currying*

November 04, 2018

We have the following function.

```
def add(x: Int, y: Int): Int = {
x + y
}
```

with the following signature

```
add: (x: Int, y: Int)Int
```

That is, `add`

is a map from the space of integer 2-tuples to the space of integers.

We say the function has an `arity`

of `n`

or is an `n-ary`

function if it takes `n`

arguments.

# Referential transparency

*Intro to referential transparency*

November 04, 2018

The notion of an *immutable binding* is the notion that a variable can be bound to a value at *most once*.

Consider the following execution block.

```
val a = "Hello"
val b = a.reverse
```

The method `reverse`

does not mutate `a`

. If one calls `a`

at a later point the return value will still be `Hello`

.

One could . . .