fsharp / fsharp/fslang-suggestions

Deprecate limitedHash functionality with next major version of Fsharp.Core

Open
#1,230 8 comments 3 reactions 0 assignees View on GitHub
approved-in-principle area: library
Dominant language
No language data
Stars
373
Forks
21
PR merge metrics
No merged PRs in 30d

Description

I propose we **deprecate** all functionality around **limited structural hashing** and it's corresponding comparer and hasher.
This is what it is supposed to be doing:
```
/// A generic hash function. This function has the same behaviour as 'hash',
/// however the default structural hashing for F# union, record and tuple
/// types stops when the given limit of nodes is reached. The exact behaviour of
/// the function can be adjusted on a type-by-type basis by implementing
/// GetHashCode for each type.
```

Searching for usages of it on GitHub or Google do not yield any productive results, please correct me if this is not the case.

## Pros and Cons

The **advantages** of making this adjustment to F# are sending a strong signal about this feature not being recommended.
There aren't really tests around it in the compiler repo and it is very likely it can have some corner cases not yet observed.

The **disadvantages** of making this adjustment to F# are that people might be using it - please do let us know if that's you.

## Extra information

Estimated cost: XS

## Affidavit (please submit!)

Please tick this by placing a cross in the box:
* [X] This is not a question (e.g. like one you might ask on [stackoverflow](http://stackoverflow.com)) and I have searched stackoverflow for discussions of this issue
* [X] I have [searched both open and closed suggestions on this site](http://github.com/fsharp/fslang-suggestions/issues) and believe this is not a duplicate
* [X] This is not something which has obviously "already been decided" in previous versions of F#. If you're questioning a fundamental design decision that has obviously already been taken (e.g. "Make F# untyped") then please don't submit it.

Please tick all that apply:
* [ ] This is not a breaking change to the F# language design
* [X] I or my company would be willing to help implement and/or test this

## For Readers

If you would like to see this issue implemented, please click the :+1: emoji on this issue. These counts are used to generally order the suggestions by engagement.

Contributor guide

No contributing guide indexed for this repository

Research direction

Locate the limited structural hashing functionality in Fsharp.Core and identify the corresponding comparer and hasher APIs mentioned in the proposal. Check their usages and existing coverage, then confirm that the relevant functionality is marked for deprecation in the next major version.

Written by the indexing model from the issue text.

Assessment

Tech stack
fsharp
Domain
backend
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.