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
Close
Hashes for algebraic-data-type-0.0.4.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 266481499c46894c5fc941c76361a98399f7607efc15126cecdc628877310372 |
|
MD5 | 8e8fe45838c2525fde483cc2c9ab0931 |
|
BLAKE2b-256 | 529d6ad2b25c8df30027b484c0f8f51f833a1c37384ee3e5718a536612b84882 |
Close
Hashes for algebraic_data_type-0.0.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 52fdca08f5288f1c46cdede840d9e5fb554296bde5539805e4e7aede2e25fb41 |
|
MD5 | 62edc8fb86955db4f2da8439c33e2946 |
|
BLAKE2b-256 | 453b373f628343fcb2f5314f8be2d21ab0158b27b3ecf4d653b9b3b1ce692731 |