Algebraic data type and pattern matching
Project description
Algebraic Data Type
To install the package pip install algebraic-data-type
ADT
[To be written]
Pattern Matching
from adt import Multimethod
with Multimethod() as fib:
fib[1] = 1
fib[2] = 1
fib[int] = lambda x: fib(x-1) + fib(x-2)
Test
To run the tests, clone the repo and use pytest
>>> git clone https://github.com/catethos/adt.git
>>> cd adt/
>>> pytest
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file algebraic-data-type-0.0.4.tar.gz.
File metadata
- Download URL: algebraic-data-type-0.0.4.tar.gz
- Upload date:
- Size: 2.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
266481499c46894c5fc941c76361a98399f7607efc15126cecdc628877310372
|
|
| MD5 |
8e8fe45838c2525fde483cc2c9ab0931
|
|
| BLAKE2b-256 |
529d6ad2b25c8df30027b484c0f8f51f833a1c37384ee3e5718a536612b84882
|
File details
Details for the file algebraic_data_type-0.0.4-py3-none-any.whl.
File metadata
- Download URL: algebraic_data_type-0.0.4-py3-none-any.whl
- Upload date:
- Size: 4.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
52fdca08f5288f1c46cdede840d9e5fb554296bde5539805e4e7aede2e25fb41
|
|
| MD5 |
62edc8fb86955db4f2da8439c33e2946
|
|
| BLAKE2b-256 |
453b373f628343fcb2f5314f8be2d21ab0158b27b3ecf4d653b9b3b1ce692731
|