Metadata-Version: 2.1
Name: functon
Version: 0.0.2.dev0
Summary: True functional programming in Python
Home-page: https://github.com/zhivykh/functon
Author: zhivykh
Author-email: zivih.n@gmail.com
Requires-Python: >=3.10,<4.0
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Project-URL: Repository, https://github.com/zhivykh/functon
Description-Content-Type: text/markdown

[![Actions Status](https://github.com/zhivykh/functon/workflows/CI/badge.svg)](https://github.com/zhivykh/functon/actions/)
[![Python 3.10](https://img.shields.io/badge/python-3.10-blue.svg)](https://www.python.org/downloads/release/python-3100/)
[![Stable Version](https://img.shields.io/pypi/v/functon?color=blue)](https://pypi.org/project/functon/)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/ambv/black)
[![Checked with mypy](http://www.mypy-lang.org/static/mypy_badge.svg)](http://mypy-lang.org/)

# Functon λ [EXPERIMENTAL]

## Installation

```
python3 -m pip install functon
```

## Usage
Hello world:

```python
>>> from functon import fn
>>> fn(print, "Hello world!")
'Hello world!'
```


Triple the value of a number:

```python
>>> from functon import defun, fn
>>> def triple(x: int) -> defun(("*", 3, "x")):
...     """Compute three times X."""
>>> fn(triple, 3)
9
```

Compute factorials using recursion:

```python
>>> from functon import defun, fn, IF
>>> def factorial(N: int) -> defun((IF, ("=", "N", 1), 1, ("*", "N", ("factorial", ("-", "N", 1))))):
...     """Compute the factorial of N."""
>>> fn(factorial, 5) 
120
```
