Datasets:
Download runtime/stdlib/result.py from Snapkitty/mantra: direct link, hf CLI and curl.
- Browser
- Download file 289 Bytes
-
https://huggingface.co/datasets/Snapkitty/mantra/resolve/main/runtime/stdlib/result.py
- Command line
-
hf download hf://datasets/Snapkitty/mantra/runtime/stdlib/result.py
-
curl -L -o result.py https://huggingface.co/datasets/Snapkitty/mantra/resolve/main/runtime/stdlib/result.py
289 Bytes
| from runtime.types import Result, Option | |
| def ok(v) -> Result: | |
| return Result(tag='ok', value=v) | |
| def err(e) -> Result: | |
| return Result(tag='err', value=e) | |
| def some(v) -> Option: | |
| return Option(tag='some', value=v) | |
| def none() -> Option: | |
| return Option(tag='none', value=None) | |