1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/// Macro to flatten nested tuple patterns from chained `join()` calls.
///
/// Chained joins produce left-nested tuples: `a.join(b).join(c)` → `((A, B), C)`.
/// This macro generates the nested pattern from a flat parameter list:
///
/// ```
/// use hyphae::{Cell, Gettable, JoinExt, MapExt, Materialize, flat};
///
/// let a = Cell::new(1);
/// let b = Cell::new(2);
/// let c = Cell::new(3);
/// let d = Cell::new(4);
///
/// // flat!(|a, b, c, d| ...) expands to |(((a, b), c), d)| ...
/// let sum = a
/// .join(b)
/// .materialize()
/// .join(c)
/// .materialize()
/// .join(d)
/// .map(flat!(|a, b, c, d| a + b + c + d))
/// .materialize();
/// assert_eq!(sum.get(), 10);
/// ```
;
=> ;
}