Done. Lists/destructuring is now a first-class chapter, and the curriculum is 7 chapters / 31 exercises: #4

Merged
navicore merged 1 commit from lists into main 2026-06-06 15:59:39 +00:00
Owner

00-intro · 01-arithmetic · 02-terms · 03-operators · 04-lists · 05-comparison · 06-recursion

The new 04-lists chapter (all four verified on plgc, including negative cases):

  1. 01-head-and-tail — [H|T] is just unification of a compound term (explicit callback to 02-terms); define
    first/2 and rest/2. Covers the one-element-list-has-tail-[] gotcha.
  2. 02-exact-length — [X, Y] vs [X|T]: exact shape vs at-least-N; the tests' + cases make the difference
    load-bearing.
  3. 03-skip-ahead — multi-element prefixes and : second([, S|_], S).
  4. 04-rebuild — heads build as well as match: swap_first_two([A, B|T], [B, A|T]) — deliberately given in the
    prose, since the point is reading it until it stops looking like magic. This is the direct seed for double-each.

Recursion chapter updated to recall, not teach: 03-sum-list's inline [H|T] tutorial is gone — it now says "you
know both halves, put them together: the tail is itself a list, only shorter." Its hint (which opened "the first
time you destructure a list…") was rewritten, and 05-double-each now names swap_first_two as the move it's
applying at every step.

Placement rationale is captured in docs/design/lists-chapter.md: 04-lists completes the term-model arc (terms →
operators → lists-as-sugar) before the computation arc; 00-intro/05-list stays as a member/2 teaser. Comparison
and recursion renumbered to 05/06 across all three trees and info.toml.

00-intro · 01-arithmetic · 02-terms · 03-operators · 04-lists · 05-comparison · 06-recursion The new 04-lists chapter (all four verified on plgc, including negative cases): 1. 01-head-and-tail — [H|T] is just unification of a compound term (explicit callback to 02-terms); define first/2 and rest/2. Covers the one-element-list-has-tail-[] gotcha. 2. 02-exact-length — [X, Y] vs [X|T]: exact shape vs at-least-N; the tests' \+ cases make the difference load-bearing. 3. 03-skip-ahead — multi-element prefixes and _: second([_, S|_], S). 4. 04-rebuild — heads build as well as match: swap_first_two([A, B|T], [B, A|T]) — deliberately given in the prose, since the point is reading it until it stops looking like magic. This is the direct seed for double-each. Recursion chapter updated to recall, not teach: 03-sum-list's inline [H|T] tutorial is gone — it now says "you know both halves, put them together: the tail is itself a list, only shorter." Its hint (which opened "the first time you destructure a list…") was rewritten, and 05-double-each now names swap_first_two as the move it's applying at every step. Placement rationale is captured in docs/design/lists-chapter.md: 04-lists completes the term-model arc (terms → operators → lists-as-sugar) before the computation arc; 00-intro/05-list stays as a member/2 teaser. Comparison and recursion renumbered to 05/06 across all three trees and info.toml.
Done. Lists/destructuring is now a first-class chapter, and the curriculum is 7 chapters / 31 exercises:
All checks were successful
CI - Linux / CI - Linux x86_64 (pull_request) Successful in 38s
2a8ca56a19
00-intro · 01-arithmetic · 02-terms · 03-operators · 04-lists · 05-comparison · 06-recursion

  The new 04-lists chapter (all four verified on plgc, including negative cases):

  1. 01-head-and-tail — [H|T] is just unification of a compound term (explicit callback to 02-terms); define
  first/2 and rest/2. Covers the one-element-list-has-tail-[] gotcha.
  2. 02-exact-length — [X, Y] vs [X|T]: exact shape vs at-least-N; the tests' \+ cases make the difference
  load-bearing.
  3. 03-skip-ahead — multi-element prefixes and _: second([_, S|_], S).
  4. 04-rebuild — heads build as well as match: swap_first_two([A, B|T], [B, A|T]) — deliberately given in the
  prose, since the point is reading it until it stops looking like magic. This is the direct seed for double-each.

  Recursion chapter updated to recall, not teach: 03-sum-list's inline [H|T] tutorial is gone — it now says "you
  know both halves, put them together: the tail is itself a list, only shorter." Its hint (which opened "the first
  time you destructure a list…") was rewritten, and 05-double-each now names swap_first_two as the move it's
  applying at every step.

  Placement rationale is captured in docs/design/lists-chapter.md: 04-lists completes the term-model arc (terms →
  operators → lists-as-sugar) before the computation arc; 00-intro/05-list stays as a member/2 teaser. Comparison
  and recursion renumbered to 05/06 across all three trees and info.toml.
navicore deleted branch lists 2026-06-06 15:59:39 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
navicore/loglings!4
No description provided.