Skip to main content

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)

example

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

algebraic-data-type-0.0.4.tar.gz (2.2 kB view hashes)

Uploaded Source

Built Distribution

algebraic_data_type-0.0.4-py3-none-any.whl (4.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page