; Iter it.2 positive (spec D1): foldl-shape accumulator. `go` recurses ; on the Cons-tail `t` at position 0 (structurally guarded) while ; threading an unconstrained accumulator `acc` at position 1. The ; accumulator position is never examined by the guardedness check, so ; this classifies as structural recursion: pure, total, Diverge-free, ; with NO `tail-app` marker. This is the single most LLM-natural ; iteration shape and must stay structural (spec D1). (module struct_rec_foldl_sum (data IntList (ctor INil) (ctor ICons (con Int) (con IntList))) (fn go (doc "Sum via a foldl-shape accumulator; structural on the tail.") (type (fn-type (params (con IntList) (con Int)) (ret (con Int)))) (params xs acc) (body (match xs (case (pat-ctor INil) acc) (case (pat-ctor ICons h t) (app go t (app + acc h)))))))