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 details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

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

Uploaded Python 3

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

Hashes for algebraic-data-type-0.0.4.tar.gz
Algorithm Hash digest
SHA256 266481499c46894c5fc941c76361a98399f7607efc15126cecdc628877310372
MD5 8e8fe45838c2525fde483cc2c9ab0931
BLAKE2b-256 529d6ad2b25c8df30027b484c0f8f51f833a1c37384ee3e5718a536612b84882

See more details on using hashes here.

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

Hashes for algebraic_data_type-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 52fdca08f5288f1c46cdede840d9e5fb554296bde5539805e4e7aede2e25fb41
MD5 62edc8fb86955db4f2da8439c33e2946
BLAKE2b-256 453b373f628343fcb2f5314f8be2d21ab0158b27b3ecf4d653b9b3b1ce692731

See more details on using hashes here.

Supported by

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