ADR-364: A Tuple May Be Nullable: (A, B)? Is Written as Any T? Is

Status: Accepted Date: October 18, 2026 Answers: whether (A, B)? is written, which ADR-278 D1 ruled out without a reason; what split_once and every function that hands back a pair that may be missing return Related: ADR-278 D1, D10, D14 (T?, ?. reaches a member); ADR-279 D1 (a ??’s fallback); ADR-352 (null as a pattern); ADR-356 (a let takes a nested tuple); Part I 2.3; Part III’s NK1254

1. Question

fn cut(path: ref String, sep: ref String) -> (String, String)? {
    let at = path.find(sep) ?? return null
    (path[0..<at].clone(), path[at + sep.len()..].clone())
}

A pair that may be missing is the result of split_once, of a search over a list of pairs, of a map’s first entry. The value exists today: find over a Vec[(String, i64)] gives one, and ?? return, let (a, b) = and a match with a null arm take it. Only the type cannot be written, so no function of the program and no std entry can return it.

2. Options

Option Example Why it lost See
Keep the rule; a named struct per result split_once -> Split? with before, after a type for each such function, and a type the language has but no one may name D1
The parts nullable (String?, String?) says that either part may be missing alone, which is not the meaning D1
A flag beside the parts (Go’s strings.Cut) (String, String, bool) the missing case can be read past; T? is how Nikaia says may be missing D1

3. Decision

D1 — (A, B)? is a type, written with the trailing ? as every T? is.

A tuple type takes the ? after its closing bracket. It lowers to Option<(A, B)>. Everything ADR-278 decides for a T? holds for it: a plain tuple stands where it is wanted, ?? gets the tuple back, null is a pattern in a match over it. NK1254 is retired and not reused.

D2 — ?. reaches a part.

p?.0 is the first part as a nullable, A?, as ?. reaches any member (ADR-278 D10); p?.0?.x reaches further, a ?. at each step (ADR-278 D14).

D3 — A fallback is a tuple.

p ?? ("", "") is a fallback of one value, the tuple, as ADR-279 D1 asks.

4. Reasons

5. Consequences

Decided October 18, 2026.

This site is open source. Improve this page.