dotnet / fsharp

The F# compiler, F# core library, F# language service, and F# tooling integration for Visual Studio
https://dotnet.microsoft.com/languages/fsharp
MIT License
3.82k stars 773 forks source link

FS-1135 implementation - random functions for collections #17277

Closed Lanayx closed 5 days ago

Lanayx commented 3 weeks ago

Description

FS-1135 implementation

Checklist

github-actions[bot] commented 3 weeks ago

:heavy_exclamation_mark: Release notes required


:white_check_mark: 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
Lanayx commented 3 weeks ago

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 commented 3 weeks ago

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 commented 3 weeks ago

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 commented 3 weeks ago

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

Ah, yeah, whoops

psfinaki commented 3 weeks ago

/azp run

azure-pipelines[bot] commented 3 weeks ago
Azure Pipelines successfully started running 2 pipeline(s).
Lanayx commented 3 weeks ago

@abelbraaksma you are welcome to review as well!

psfinaki commented 3 weeks ago

/azp run

azure-pipelines[bot] commented 3 weeks ago
Azure Pipelines successfully started running 2 pipeline(s).
KevinRansom commented 3 weeks ago

Why would this functionality need to exist in the core runtime library? I would imagine that they could usefully exist in a nuget package and be downloaded only when someone actually had a need for them.

Whilst I am sure there are some apps that would benefit from access to this type of functionality, I don't expect it would be wouldn't be most or even many.

FSharp.Core is already much too big, and we ship two damned versions of it. And when it gets Crossgened or Ngened it gets huge, currently 5 MB.

We need to consider mechanisms to shrink FSharp.Core and only add to it, genuinely core functionality, that support core language features.

KevinRansom commented 3 weeks ago

@smoothdeveloper posted this sugestion to the fslang suggestions thread:

https://github.com/fsharp/fslang-design/pull/732#issuecomment-2155552366

He also pointed out FSharpStats, which might be a good home for this type of functionality.

https://github.com/fslaborg/FSharp.Stats

psfinaki commented 1 week ago

/azp run

azure-pipelines[bot] commented 1 week ago
Azure Pipelines successfully started running 2 pipeline(s).
psfinaki commented 1 week ago

/azp run

azure-pipelines[bot] commented 1 week ago
Azure Pipelines successfully started running 2 pipeline(s).
psfinaki commented 5 days ago

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