# Welcome

Funkcia is a TypeScript library that provides robust error handling and functional programming primitives, heavily inspired by Rust's error handling patterns and functional programming concepts.

It provides a comprehensive toolkit for writing more reliable code with better error handling and functional programming patterns, making it easier to write maintainable and type-safe applications.

{% tabs %}
{% tab title="npm" %}
{% code fullWidth="true" %}

```bash
npm i funkcia
```

{% endcode %}
{% endtab %}

{% tab title="pnpm" %}

```bash
pnpm add funkcia
```

{% endtab %}

{% tab title="bun" %}

```bash
bun add funkcia
```

{% endtab %}

{% tab title="yarn" %}

```bash
yarn add funkcia
```

{% endtab %}
{% endtabs %}

### Jump right in

<table data-card-size="large" data-view="cards" data-full-width="true"><thead><tr><th></th><th></th><th data-hidden data-card-cover data-type="files"></th><th data-hidden></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td>Option</td><td></td><td></td><td></td><td><a href="data-types/option">option</a></td></tr><tr><td>Result</td><td></td><td></td><td></td><td><a href="data-types/result">result</a></td></tr><tr><td>OptionAsync</td><td></td><td></td><td></td><td><a href="data-types/optionasync">optionasync</a></td></tr><tr><td>ResultAsync</td><td></td><td></td><td></td><td><a href="data-types/resultasync">resultasync</a></td></tr><tr><td>Brand</td><td></td><td></td><td></td><td><a href="modules/brand">brand</a></td></tr><tr><td>Pattern Matching</td><td></td><td></td><td></td><td><a href="modules/pattern-matching">pattern-matching</a></td></tr></tbody></table>

### Docs parity checklist

Before publishing docs updates:

* Verify public API names against source exports in `/packages/funkcia/src`.
* Ensure method headings match API casing exactly.
* Remove stale methods that no longer exist in source.
* Confirm `SUMMARY.md` links point to real files.
* Run a quick search for known removed APIs to avoid drift regressions.


---

# 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://funkcia.lukemorales.io/readme.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.
