# Module /func

Higher-order function utilities including partial application, currying, composition, and memoization.

```tangu
(use /func)
```

## Functions & symbols

### apply

`(apply func args) -> Any`

Calls `func` with elements of `args` unpacked as positional arguments.

| Parameter | Type | Optional | Description |
| :--- | :--- | :--- | :--- |
| `func` | `Func` | no | Invocable function |
| `args` | `Array` | no | Argument Array to spread into `func` |

```tangu
(func/apply + [1 2 3 4]) ; -> 10
```

### curry

`(curry func) -> Func`

Curries a multi-parameter function into nested single-argument closures.

| Parameter | Type | Optional | Description |
| :--- | :--- | :--- | :--- |
| `func` | `Func` | no | Multi-parameter function to convert into single-argument curried form |

```tangu
(let add5 ((func/curry (Func [a b] (+ a b))) 5))
```

### memoize

`(memoize func) -> Func`

Returns a memoized wrapper around `func` caching computed outputs by argument tuple.

| Parameter | Type | Optional | Description |
| :--- | :--- | :--- | :--- |
| `func` | `Func` | no | Pure function to wrap with an argument->result cache |

```tangu
(let fast-fib (func/memoize slow-fib))
```
