diff --git a/src/FSharpPlus/Operators.fs b/src/FSharpPlus/Operators.fs index 44130d98f..8d1eba66d 100644 --- a/src/FSharpPlus/Operators.fs +++ b/src/FSharpPlus/Operators.fs @@ -3,6 +3,8 @@ namespace FSharpPlus open System open FSharpPlus.Control +#nowarn "0077" // Member constraints with the name 'set_Item' ... + /// Generic functions and operators [] module Operators = @@ -849,6 +851,17 @@ module Operators = /// Indexable let inline tryItem (n: 'K) (source: '``Indexed<'T>``) : 'T option = TryItem.Invoke n source + /// + /// Mutates an item at the given key/index. + /// + /// The key/index where to set the value. + /// The value to set. + /// The input collection. + /// unit + /// This function requires that the source type has a mutable indexer. + /// Indexable + let inline setItem (item: 'K) (value: 'T) (source: ^``Indexed<'T>``) = (^``Indexed<'T>`` : (member set_Item : 'K -> 'T -> unit) (source, item, value)) + /// /// Maps with access to the index. ///