Skip to content

Land Data.Tuple as the closed record { _1, _2 } - #136

Merged
biuld merged 9 commits into
masterfrom
stdlib/data-tuple
Oct 4, 2026
Merged

biuld merged 9 commits into
masterfrom
stdlib/data-tuple

Conversation

@biuld

@biuld biuld commented Oct 4, 2026

Copy link
Copy Markdown
Owner

Tuple a b is the record FE-06 already lowers a tuple to, not an
algebraic product. The module exports fst, snd, curry, uncurry, and
swap, and no Eq, Ord, Show, or Functor instances. It loads after
Data.Either because it is not a Prelude re-export and depends on
neither Maybe nor Either.

Measured with PSRS_ORACLE=annotations cargo test -p psrs-driver --test
suite -- l2_resolution_scoreboard_with_annotations --ignored
--nocapture, on 6f66524 and again after this module: passing resolution
stays 245/413, missing modules move from 57 to 56, and other P3
blockers move from 107 to 108. M2 failing agreement stays 72/72. The
L6 stage table was not re-run.

biuld and others added 9 commits October 4, 2026 06:32
Tuple a b is the record FE-06 already lowers a tuple to, not an
algebraic product. The module exports fst, snd, curry, uncurry, and
swap, and no Eq, Ord, Show, or Functor instances. It loads after
Data.Either because it is not a Prelude re-export and depends on
neither Maybe nor Either.

Measured with PSRS_ORACLE=annotations cargo test -p psrs-driver --test
suite -- l2_resolution_scoreboard_with_annotations --ignored
--nocapture, on 6f66524 and again after this module: passing resolution
stays 245/413, missing modules move from 57 to 56, and other P3
blockers move from 107 to 108. M2 failing agreement stays 72/72. The
L6 stage table was not re-run.
Add stdlib/lib/Data/Show.purs: the Show class, its show method, and the
Boolean, Int, Number, Char, String, Unit, and Array a instances. Prelude
re-exports the class and method, and stdlib/lib/trusted loads the module
after Data.Semiring.

Number rendering is library code over the numeric primitives, not a new
intrinsic and not a correctly rounded ECMAScript conversion. Records,
Maybe, Either, and Tuple stay out: records need reflectSymbol, and the
other modules belong to later slices. logShow and assertEqual stay with
#95.

On this master, L2 passing resolution moves from 245/413 to 253/413 and
other P3 blockers from 107 to 99. show and Show are no longer first-blocker
names. D-04 and D-15 record the measurement.
Add Data.Monoid (mempty for String, Unit, and Array a) and Data.Foldable
(foldr, foldl, and foldMap, with Array, Maybe, and Either a instances).
foldMap's type is constrained by Monoid, so the two classes are one slice:
on 6f66524 they are the highest compile-path Data blockers #124 owns and
#96 does not. The Array instance walks arrayLength and arrayIndex. fold is
omitted, because foldMap of the identity under a quantified Foldable f
projects a rank-2 method from a dictionary parameter and fails CC
verification, which rejects every program that does not prune the library.

Measured on 6f66524 by the compile-path scoreboard classification: missing
library 57 -> 55, P3 107 -> 109, lenient passing resolution unchanged at
245/413, P10 172, P5 typecheck 40, P5 kind check 17, P8 12, P6 4, P0 4.
Data.Foldable was 4 and Data.Monoid 3; five of those seven files stop on a
later missing module and two stop at another P3 error.

Wasmtime 48.0.0 executes the monoid identities and the Array, Maybe, Either,
and user-instance folds. purs 0.15.16.
cargo fmt orders the test module declarations alphabetically, so
`mod foldable` belongs after `mod effects` and before `mod guard_coverage`.
Keep both Data.Show and Data.Foldable. The D-04 scoreboard figures were
measured independently on 6f66524 and are not additive.
The module is in stdlib/lib/trusted, so the order assertion has to name
it or loads_the_standard_library_from_disk_in_trusted_order fails.
Keep Data.Show, Data.Foldable, and Data.Tuple. Scoreboard figures from
the three slices were measured independently on 6f66524 and are not additive.
Take the trusted-order loader assertion that names Data.Show.
Include the trusted-order loader assertion that names Data.Show.
@biuld
biuld merged commit 071fb11 into master Oct 4, 2026
2 checks passed
@biuld
biuld deleted the stdlib/data-tuple branch October 4, 2026 09:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant