You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The regularizeValues function is located in Interpolation.Approximation. While it is currently only used here, it is of bread interest to have this function available on a more global layer. It could be moved to the Seq/List/Array/Vector modules, or to its own source file in the Signal namespace.
Agreed that regularizeValues has broad utility beyond interpolation. Here's a concrete migration path:
Where it is now:Interpolation.Approximation.regularizeValues (line ~2173 of Interpolation.fs)
Proposed move: Add the function to FSharp.Stats.Array, Seq, and List modules (or a shared helper module) with a more descriptive name — something like sortAndAggregateByKey or groupByKeyAndAggregate. The signature would generalise naturally:
// In Array/Seq/List modules:valsortAndAggregateByKey:('a -> 'b) ->(seq<'a>->'a)->seq<('b * 'a)>->seq<('b * 'a)>// or keeping the paired-arrays style:valregularize:x(redacted)->y(redacted)->ties:(seq<float>-> float) ->seq<float*float>
Backward compatibility: Keep Interpolation.Approximation.regularizeValues as a thin wrapper calling the new location, marked [<Obsolete>] if desired.
Benefit beyond interpolation: The function is also useful for histogramming, signal resampling, and any workflow where duplicate keys need aggregating before downstream processing — so Seq/Array feels like the right home.
Happy to implement this as a PR if maintainers agree on the target location and naming.
Activity
github-actions commentedon Apr 17, 2026
🤖 This is an automated response from Repo Assist.
Agreed that
regularizeValueshas broad utility beyond interpolation. Here's a concrete migration path:Where it is now:
Interpolation.Approximation.regularizeValues(line ~2173 ofInterpolation.fs)Proposed move: Add the function to
FSharp.Stats.Array,Seq, andListmodules (or a shared helper module) with a more descriptive name — something likesortAndAggregateByKeyorgroupByKeyAndAggregate. The signature would generalise naturally:Backward compatibility: Keep
Interpolation.Approximation.regularizeValuesas a thin wrapper calling the new location, marked[<Obsolete>]if desired.Benefit beyond interpolation: The function is also useful for histogramming, signal resampling, and any workflow where duplicate keys need aggregating before downstream processing — so
Seq/Arrayfeels like the right home.Happy to implement this as a PR if maintainers agree on the target location and naming.