Commit 9eff213
committed
docs(AI.a2ml): add 4 idiomatic patterns + 3 directives from idaptik feedback
Closes #45 #46 #47 #48 #49 #50 #52.
Adds patterns surfaced during the IDApTIK Wave 3 pilot exercise:
* per-element-error-extraction (closes #46) — polymorphic-per-element
helper for accumulating errors from heterogeneously-typed Validation
values; eliminates the dominant ReScript→AffineScript migration
antipattern documented in idaptik's ProvenBridge.idr (4 sites).
* fuel-based-total-recursion (closes #47) — canonical pattern for
provably-total recursive parsers/interpreters. Counter-pattern to
depth-tracking, which the totality checker cannot see as
well-founded (depth increments rather than decreases).
* validation-chain-over-tuple-match (closes #49) — Validation
applicative chain replaces N-tuple `case` matches. N>=5 tuple
matches blow ambiguity-resolution budgets in real translation
(verified in idaptik's parseLevelJson).
* status-sum-vs-string-enum (closes #52) — sum types replace
stringly-typed dispatch. Small but pervasive.
Adds three new directives:
* stdlib-floor (closes #45) — Validation/Result/Option/Either are
stdlib floor; reject re-implementations.
* eta-style (closes #48) — eta-expand definitions when a function
has named pi-binders. Point-free is a parser-cascade trigger.
* no-side-effect-imports (closes #50) — `let _ = X.foo` for
module-load side effects must rewrite to explicit registration in
AffineScript (no module-load-time side effect in wasm).
All seven additions cross-reference idaptik's commit hyperpolymath/idaptik@98f110ce
and the LESSONS.md catalogue at idaptik/migration/main/LESSONS.md.1 parent 2f43839 commit 9eff213
1 file changed
Lines changed: 34 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
138 | 138 | | |
139 | 139 | | |
140 | 140 | | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
141 | 169 | | |
142 | 170 | | |
143 | 171 | | |
| |||
157 | 185 | | |
158 | 186 | | |
159 | 187 | | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
160 | 194 | | |
161 | 195 | | |
162 | 196 | | |
| |||
0 commit comments