Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FS-1135 implementation - random functions for collections #17277

Merged
merged 29 commits into from
Jun 26, 2024

Conversation

Lanayx
Copy link
Contributor

@Lanayx Lanayx commented Jun 4, 2024

Description

FS-1135 implementation

Checklist

  • Test cases added

  • Performance benchmarks added in case of performance changes

  • Release notes entry updated:

    Please make sure to add an entry with short succinct description of the change as well as link to this pull request to the respective release notes file, if applicable.

    Release notes files:

    • If anything under src/Compiler has been changed, please make sure to make an entry in docs/release-notes/.FSharp.Compiler.Service/<version>.md, where <version> is usually "highest" one, e.g. 42.8.200
    • If language feature was added (i.e. LanguageFeatures.fsi was changed), please add it to docs/releae-notes/.Language/preview.md
    • If a change to FSharp.Core was made, please make sure to edit docs/release-notes/.FSharp.Core/<version>.md where version is "highest" one, e.g. 8.0.200.

    Information about the release notes entries format can be found in the documentation.
    Example:

    If you believe that release notes are not necessary for this PR, please add NO_RELEASE_NOTES label to the pull request.

@Lanayx Lanayx requested a review from a team as a code owner June 4, 2024 21:05
Copy link
Contributor

github-actions bot commented Jun 4, 2024

❗ Release notes required


✅ Found changes and release notes in following paths:

Change path Release notes path Description
src/FSharp.Core docs/release-notes/.FSharp.Core/8.0.400.md

FSharp.sln Outdated Show resolved Hide resolved
src/FSharp.Core/local.fs Outdated Show resolved Hide resolved
src/FSharp.Core/local.fs Outdated Show resolved Hide resolved
src/FSharp.Core/array.fs Outdated Show resolved Hide resolved
src/FSharp.Core/array.fs Outdated Show resolved Hide resolved
src/FSharp.Core/array.fs Outdated Show resolved Hide resolved
src/FSharp.Core/list.fs Show resolved Hide resolved
src/FSharp.Core/list.fs Outdated Show resolved Hide resolved
src/FSharp.Core/local.fs Outdated Show resolved Hide resolved
@Lanayx
Copy link
Contributor Author

Lanayx commented Jun 5, 2024

Can somebody please help me pass unit tests? It fails with
Expected and actual surface area don't match. To see the delta, run:

@brianrourkeboll
Copy link
Contributor

brianrourkeboll commented Jun 5, 2024

Can somebody please help me pass unit tests? It fails with Expected and actual surface area don't match. To see the delta, run:

I think you might want to run something like this

$env:TEST_UPDATE_BSL=1
>> dotnet test tests/FSharp.Core.UnitTests/FSharp.Core.UnitTests/ -c Release --filter "SurfaceArea"

That should update the baselines (sometimes you may need to run it twice), which you can then commit.

@Lanayx
Copy link
Contributor Author

Lanayx commented Jun 5, 2024

Can somebody please help me pass unit tests? It fails with Expected and actual surface area don't match. To see the delta, run:

I think you might want to run something like this

$env:TEST_UPDATE_BSL
>> dotnet test tests/FSharp.Core.UnitTests/FSharp.Core.UnitTests -c Release --filter "SurfaceArea"

That should update the baselines (sometimes you may need to run it twice), which you can then commit.

Thanks it worked, just as I figured out it should be $env:TEST_UPDATE_BSL=1

@brianrourkeboll
Copy link
Contributor

just as I figured out it should be $env:TEST_UPDATE_BSL=1

Ah, yeah, whoops

@psfinaki psfinaki changed the title FS-1135 implementation FS-1135 implementation - random functions for collections Jun 6, 2024
@psfinaki
Copy link
Member

psfinaki commented Jun 6, 2024

/azp run

Copy link

Azure Pipelines successfully started running 2 pipeline(s).

src/FSharp.Core/array.fs Show resolved Hide resolved
@Lanayx
Copy link
Contributor Author

Lanayx commented Jun 6, 2024

@abelbraaksma you are welcome to review as well!

@psfinaki
Copy link
Member

/azp run

Copy link

Azure Pipelines successfully started running 2 pipeline(s).

Copy link
Member

@psfinaki psfinaki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this, great effort and great docs.

I haven't looked into the implementation yet, I was rather checking if the API adheres to the RFC - which it does, apart from one exception type in one case.

I will finish my review soon. Overall, I am up for merging this in its current shape. I think this API is good enough. It could probably be made thinner or more discoverable, as per discussions in the related threads. But unless it proves to be a performance trap AND cannot be optimized within the API boundaries in followups - I don't think it's worth starting the design process all over again.

src/FSharp.Core/seq.fsi Outdated Show resolved Hide resolved
src/FSharp.Core/seq.fsi Outdated Show resolved Hide resolved
src/FSharp.Core/local.fs Show resolved Hide resolved
src/FSharp.Core/local.fs Outdated Show resolved Hide resolved
@psfinaki
Copy link
Member

/azp run

Copy link

Azure Pipelines successfully started running 2 pipeline(s).

Copy link
Member

@psfinaki psfinaki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good stuff, I am for getting this in (see my comment above).

The implementation LGTM, just give us some time to figure out all this exception naming stuff, also the CI is broken right now.

@psfinaki
Copy link
Member

Alright, let's get this in. Thanks for your work @Lanayx. Let's spread the word :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

6 participants