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

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page