# Functional Composition

## Syntax

```swift
f + g
```

## Explanation

Performs functional composition on the two operands. Returns a function which passes its arguments to `g` and then too `f`.

The following are equivilent:

```swift
(f + g)(a,b) == f(g(a,b))
```

## Examples

An example to change a zero-indexed function to a one-indexed function utilizing composition is:

```swift
let fibonacci = n f -> n < 2 ? 1 : f(n - 1) + f(n - 2);
let increment = (+) & 1;

( fibonacci + increment )( 5 ) == 13
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.cheddar.vihan.org/docs/functions/operations/functional-composition.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
