Scheme Request for Implementation 189,
"Maybe and Either: optional container types,"
by John Cowan (text), Wolfgang Corcoran-Mathe (sample implementation),
has gone into final status.
The document and an archive of the discussion are available at https://srfi.schemers.org/srfi-189/.
Here's the abstract:
This SRFI defines two disjoint immutable container types known as Maybe and Either, both of which can contain objects collectively known as their payload. A Maybe object is either a Just object or the unique object Nothing (which has no payload); an Either object is either a Right object or a Left object. Maybe represents the concept of optional values; Either represents the concept of values which are either correct (Right) or errors (Left). Note that the terms Maybe, Just, Nothing, Either, Right, and Left are capitalized in this SRFI so as not to be confused with their ordinary use as English words. Thus "returns Nothing" means "returns the unique Nothing object"; "returns nothing" could be interpreted as "returns no values" or "returns an unspecified value".
Here is the commit summary since the most recent draft:
- degenerate maybe-and and maybe-or swapped
- Add -let*-values forms.
- Move syntax tests to their own file. Add tests for -let*-values forms.
- add identifier-as-claw
- added Shiro to acks
- exception type specified; definition of claws clarified; exception->either added
- restored line dropped in error
- Add exception->either.
- Use error to signal errors in macros.
- exception->either: thunk can return multiple values
- Ensure the correct error objects are signaled in a few missed cases.
- Fix typo.
- Fix typo in test.
- bad reading of SRFI 2
- Use absolute link to "srfi.css".
- exception->either: Use guard.
- Add either-guard.
- Add tests for exception->either and either-guard.
- The -let*(-values) forms wrap their body expressions.
- Update tests for -let*(-values) to conform to 88438c1c.
- Add tests for error conditions in syntax.
- Amend test overlooked in 1e8354f4.
- <h1></h1> -> <h2></h2> to match new format.
- Fix problems reported by W3C HTML Validator.
- explicit note on argument types
Here are the diffs since the most recent draft:
Many thanks to John and to everyone who contributed to the discussion of this SRFI.