https://github.com/mfelsche/pony-maybe
Utilities for working with optional values in Pony :horse: :no_entry_sign:
https://github.com/mfelsche/pony-maybe
optional pony-language ponylang
Last synced: about 2 months ago
JSON representation
Utilities for working with optional values in Pony :horse: :no_entry_sign:
- Host: GitHub
- URL: https://github.com/mfelsche/pony-maybe
- Owner: mfelsche
- Created: 2018-11-22T12:59:27.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-04-20T08:23:37.000Z (about 5 years ago)
- Last Synced: 2025-01-20T04:18:52.638Z (3 months ago)
- Topics: optional, pony-language, ponylang
- Language: Pony
- Homepage:
- Size: 9.77 KB
- Stars: 6
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# pony-maybe
Utilities for handling optional data in Pony.
## Status
[](https://circleci.com/gh/mfelsche/pony-maybe)
## Installation
* Install [pony-stable](https://github.com/ponylang/pony-stable)
* Update your `bundle.json````json
{
"type": "github",
"repo": "mfelsche/pony-maybe"
}
```* `stable fetch` to fetch your dependencies
* `use "maybe"` to include this package
* `stable env ponyc` to compile your application## Usage
```pony
use "maybe"class WithOptionalStuff
let _stuff: Maybe[String] = Nonefun update_stuff(new_stuff: String): Maybe[String] =>
_stuff = new_stufffun size(): USize =>
Opt.get[USize](
Opt.map[String, USize](_stuff, {(s) => s.size() }),
0
)
```