Skip to main content

"Either" and "Maybe" data structures

Project description

https://github.com/kennknowles/python-either

This library provides two fundamental near-trivial data structures for Python:

  • Either also known as “coproduct”, “sum type”, “variant”, “tagged union”, “disjoint union”, etc: A value that comes from one of two sets

  • Maybe also known as “option” or “Either Nothing”: A value that may be missing. (Python has “None” but it does not compose)

Each is ~10 lines, mostly boilerplate, but now they are in one place in a library.

Further Reading:

If you are unfamiliar with these concepts, here is some reading from around the web:

Either:

Maybe:

Contributors

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

either-0.2.tar.gz (5.5 kB view hashes)

Uploaded Source

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