Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RFC: Iter maybe #3593

Closed
Theodus opened this issue Jul 14, 2020 · 0 comments · Fixed by #3603
Closed

RFC: Iter maybe #3593

Theodus opened this issue Jul 14, 2020 · 0 comments · Fixed by #3603
Assignees
Labels
enhancement New feature or request

Comments

@Theodus
Copy link
Contributor

Theodus commented Jul 14, 2020

This RFC suggests adding functionality inspired by the maybe library to the Pony stdlib via the itertools package. This provides an alternative API to work with optional types, that is union types with None: ( T | None). Its goal is to facilitate the usage of such optional types for people for which using pattern matching (using match or as expressions) is not convenient. Such types are very common for mutable fields on a class that need to be initialized but there is no value in the optional type to encode a missing thing. In those cases a union with None is initialized to None and updated at a later point.

RFC 66: https://github.com/ponylang/rfcs/blob/master/text/0066-iter-maybe.md

@Theodus Theodus added the enhancement New feature or request label Jul 14, 2020
@Theodus Theodus self-assigned this Jul 14, 2020
Theodus added a commit that referenced this issue Jul 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant