Add Effect.Console.logShow over the library Show - #138
Merged
Merged
Conversation
`logShow :: forall a. Show a => a -> Effect Unit` is `log` of
`Data.Show.show`, so it adds no I/O and no second stringifier: the
rendering is the library's `Show` and the destination is still the one
`WASI.Console.log` decides.
`logShow` was the largest single P3 name blocker at 24 cases, 19 of them
reported as "`logShow` is not exported by the imported module". Measured
with `PSRS_REQUIRE_WASMTIME=1 PSRS_ORACLE=annotations cargo test -p
psrs-driver --test suite -- --ignored --nocapture` at `071fb11` plus this
slice, `passing` resolution moves 253/413 to 270/413. Of the 24, 17
resolve past L2 and 7 stop at the next P3 name, which is visible for the
first time now that nothing shadows it: `Monad` and `compare` 2 each, and
`negate`, `not`, and `_` 1 each. The 17 land at later stages as 10 P10,
4 P5 typecheck, 1 P8, and 2 P6.
`Test.Assert.assertEqual`/`assertEqual'` stay absent, and the reason is a
compiler defect rather than a missing class. Both classes are declared,
but the official signature is `forall a. Eq a => Show a => String ->
{ actual :: a, expected :: a } -> Effect Unit`, and a constraint whose
quantified variable appears inside a record type is elaborated with the
*record* as the constraint's argument, so `Eq a` is wanted for
`{ actual :: a, expected :: a }`. #137 carries the reproduction and the
probes that separate this from record syntax. Approximating the argument
shape would change the API the corpus calls, so the two functions stay
out; that leaves 2 `passing` cases blocked.
D-04 now carries one consistent measurement of all five boards rather than
three independent `6f66524` figures that were not additive. The L5 row
said 84; the per-code totals sum to 80 and the remeasurement confirms 80.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Effect.Console.logShow :: forall a. Show a => a -> Effect Unit, defined aslog (show value). It adds no I/O and no second stringifier: the rendering isthe library's
Show, and the destination is still the oneWASI.Console.logdecides. This is the wrapper #95 has been holding since the
Showclass landed.Test.Assert.assertEqual/assertEqual'stay absent, andstdlib/lib/Test/Assert.pursnow records why. It is no longer a missing class —
EqandShoware bothdeclared — it is a compiler defect (#137).
Measured
PSRS_REQUIRE_WASMTIME=1 PSRS_ORACLE=annotations cargo test -p psrs-driver --test suite -- --ignored --nocapture, at071fb11plus this slice:passingresolvedlogShowwas the largest single P3 name blocker at 24 cases (19 reported as"
logShowis not exported by the imported module"). Of those, 17 resolve pastL2; the other 7 stop at the next P3 name, which nothing shadowed before:
Monadandcompare2 each, andnegate,not, and_1 each. The 17 land atlater stages as 10 P10, 4 P5 typecheck, 1 P8, and 2 P6.
The
assertEqualblockerThe official signature is
and this compiler elaborates
Eq aagainst the record rather thana, so thewanted constraint comes out as
Eq { actual :: a, expected :: a }. Probes thatseparate this from record syntax:
forall a. Eq a => a -> Intforall a. String -> { actual :: a, expected :: a } -> Int(no constraint)forall a. { actual :: a, expected :: a } -> a— field accessforall a. { actual :: a, expected :: a } -> a— record patternforall a. Eq a => { actual :: a, expected :: a } -> IntSo the record with quantified fields is fine on its own and both destructuring
forms work; only the constraint combined with the record fails. Filed as #137 with
the reproduction. Changing the argument shape would change the API the corpus
calls, so the two functions stay out — 2
passingcases remain blocked.Validation
New execution test
tests::assertions::log_show_writes_the_library_renderingasserts the six renderings under Wasmtime, so a second stringifier would fail it.
Its negative case is written
0 - 7rather than- 7because unary minus stillresolves through a
negatethis library does not declare.Board
Corpus casesrecounted from the run above: #95 19 → 2, #94 70 → 77, #96 12 → 17,#124 25 → 27. #94 goes up because the 7 cases that stopped on
logShowstop on aPreludename #94 also owns.