Name | maybedata JSON |
Version |
0.8
JSON |
| download |
home_page | None |
Summary | A Python implementation of a Maybe type that represents potentially missing values |
upload_time | 2022-12-11 16:43:52 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.10 |
license | None |
keywords |
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# maybedata
This is a package that implements a Maybe data type in Python that represents values that might or might not exist.
It is implemented as a class hierarchy with an abstract base class `Maybe`. This class is not constructible, but can be called to construct members of its subclasses, `Just` and `Nothing`.
All methods are documented, feel free to call `help()` on the classes!
Call `Maybe(value)` or `Just(value)` to create a value that is present.
Call `Maybe()` or `Nothing()` to create a missing value.
Check `maybe.present` to find out if a value is present.
Access `maybe.value` to get the value if it is present.
Call `maybe.assume_present()` to raise an exception if the value is not present.
Call `maybe.get(default)` to get the value or a default value.
`Maybe` and `Just` are generic classes if you use type hinting.
`Just` and `Nothing` support pattern matching.
`Maybe`, `Just`, and `Nothing` support `len()`, `bool()`, `hash()`, `iter()`, `in`, and `==`.
The method `maybe.alternatively()` can be expressed using `|`.
The method `maybe.then()` can be expressed using `>>`.
Raw data
{
"_id": null,
"home_page": null,
"name": "maybedata",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.10",
"maintainer_email": null,
"keywords": null,
"author": null,
"author_email": "Anselm Sch\u00fcler <mail@anselmschueler.com>",
"download_url": "https://files.pythonhosted.org/packages/31/2a/f5bf0b108d48f363a908ec926452dc7b634f85020f3d20a4cd194b06ebb2/maybedata-0.8.tar.gz",
"platform": null,
"description": "# maybedata\n\nThis is a package that implements a Maybe data type in Python that represents values that might or might not exist.\n\nIt is implemented as a class hierarchy with an abstract base class `Maybe`. This class is not constructible, but can be called to construct members of its subclasses, `Just` and `Nothing`.\n\nAll methods are documented, feel free to call `help()` on the classes!\n\nCall `Maybe(value)` or `Just(value)` to create a value that is present.\n\nCall `Maybe()` or `Nothing()` to create a missing value.\n\nCheck `maybe.present` to find out if a value is present.\n\nAccess `maybe.value` to get the value if it is present.\n\nCall `maybe.assume_present()` to raise an exception if the value is not present.\n\nCall `maybe.get(default)` to get the value or a default value.\n\n`Maybe` and `Just` are generic classes if you use type hinting.\n\n`Just` and `Nothing` support pattern matching.\n\n`Maybe`, `Just`, and `Nothing` support `len()`, `bool()`, `hash()`, `iter()`, `in`, and `==`.\n\nThe method `maybe.alternatively()` can be expressed using `|`.\n\nThe method `maybe.then()` can be expressed using `>>`.\n",
"bugtrack_url": null,
"license": null,
"summary": "A Python implementation of a Maybe type that represents potentially missing values",
"version": "0.8",
"split_keywords": [],
"urls": [
{
"comment_text": null,
"digests": {
"md5": "93dc14f5c06497d0f5420c98db0b5e8b",
"sha256": "8dd49c748ff185a24255f203bfcee38bf2839b10a67487308b7a544b55231f05"
},
"downloads": -1,
"filename": "maybedata-0.8-py3-none-any.whl",
"has_sig": false,
"md5_digest": "93dc14f5c06497d0f5420c98db0b5e8b",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10",
"size": 7498,
"upload_time": "2022-12-11T16:43:48",
"upload_time_iso_8601": "2022-12-11T16:43:48.108332Z",
"url": "https://files.pythonhosted.org/packages/64/1f/844ff83384bb9ce27f4f2e1c31881b45001df5013b77993f5ddb62fb5a16/maybedata-0.8-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"md5": "8b16cd3a05ab07f3d5b73f25234c5657",
"sha256": "406a23dd10a02b24c2a143284bb1a82830570bb565c37fc45cd9021abdae0adf"
},
"downloads": -1,
"filename": "maybedata-0.8.tar.gz",
"has_sig": false,
"md5_digest": "8b16cd3a05ab07f3d5b73f25234c5657",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10",
"size": 7260,
"upload_time": "2022-12-11T16:43:52",
"upload_time_iso_8601": "2022-12-11T16:43:52.882836Z",
"url": "https://files.pythonhosted.org/packages/31/2a/f5bf0b108d48f363a908ec926452dc7b634f85020f3d20a4cd194b06ebb2/maybedata-0.8.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2022-12-11 16:43:52",
"github": false,
"gitlab": false,
"bitbucket": false,
"lcname": "maybedata"
}