Land Data.Monoid and Data.Foldable - #135
Merged
Merged
Conversation
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.
Take the trusted-order loader assertion that names Data.Show.
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.
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.