- 신선한 탐사자(fable) 단일 컨텍스트, 지시서 -round10-brief.md §2 레인 A·C 완료, B 부분, D ALL PASS - audit/handtrace-round10-reference-impl/: round7 참조 구현을 현재 계약으로 갱신·재실행 (부수: round7/ref9 _recompute 첫 인자 오류 발견·정정) - base/·인덱스 레이어는 미변경 — 결정은 사용자 배치 회신 뒤 -round10-followup.md로 Co-authored-by: qwreey <me@qwreey.moe> Claude-Session: https://claude.ai/code/session_01546hjsYNLSMZdHdPyTZaGb
20 lines
901 B
Text
20 lines
901 B
Text
--!strict
|
|
export type StateData<T> = { Get: (self: StateData<T>) -> T }
|
|
export type SourceData<T> = { Get: (self: SourceData<T>) -> T, Revision: number }
|
|
export type State<T> = StateData<T> & {
|
|
Compute: <U>(self: StateData<T>, fn: (self: StateData<T>, prev: U?) -> U) -> U,
|
|
ComputeN: <U, D...>(self: StateData<T>, fn: (self: StateData<T>, prev: U?, D...) -> U, D...) -> U,
|
|
}
|
|
local s: State<number> = nil :: any
|
|
local a: SourceData<number> = nil :: any
|
|
|
|
-- (A) deps 0개 — typing-limits ②쪼개기가 확인한 "무주석 통과"
|
|
local r1 = s:Compute(function(self) return self:Get() * 2 end)
|
|
local n1: number = r1
|
|
|
|
-- (B) deps 1개 + 무주석
|
|
local r2 = s:ComputeN(function(self, prev, d1) return self:Get() + d1:Get() end, a)
|
|
|
|
-- (C) deps 1개 + dep만 주석
|
|
local r3 = s:ComputeN(function(self, prev, d1: SourceData<number>) return self:Get() + d1:Get() end, a)
|
|
local n3: number = r3
|