Skip to content

Commit 5b07481

Browse files
committed
Fix: missing functor instances for IDictionary and IReadOnlyDictionary
1 parent 67d1b75 commit 5b07481

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/FSharpPlus/Control/Functor.fs

+3-1
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,8 @@ type Map =
9292
static member Map ((x: Map<'Key,'T> , f: 'T->'U), _mthd: Map) = Map.map (const' f) x : Map<'Key,'U>
9393
static member Map ((x: Dictionary<_,_> , f: 'T->'U), _mthd: Map) = Dictionary.map f x : Dictionary<'Key,'U>
9494
#if !FABLE_COMPILER
95+
static member Map ((x: IDictionary<_,_> , f: 'T->'U), _mthd: Map) = Dict.map f x : IDictionary<'Key,'U>
96+
static member Map ((x: IReadOnlyDictionary<_,_>, f: 'T->'U), _mthd: Map) = IReadOnlyDictionary.mapValues f x : IReadOnlyDictionary<'Key,'U>
9597
static member Map ((x: Expr<'T> , f: 'T->'U), _mthd: Map) = Expr.Cast<'U> (Expr.Application (Expr.Value (f), x))
9698
#endif
9799

@@ -129,7 +131,7 @@ type Map with
129131
static member Map ((x: NonEmptySeq<_> , f: 'T->'U), _mthd: Default2) = NonEmptySeq.map f x : NonEmptySeq<'U>
130132
static member Map ((x: IEnumerator<_> , f: 'T->'U), _mthd: Default2) = Enumerator.map f x : IEnumerator<'U>
131133
static member Map ((x: IDictionary<_,_> , f: 'T->'U), _mthd: Default2) = Dict.map f x : IDictionary<'Key,'U>
132-
static member Map ((x: IReadOnlyDictionary<_,_>, f: 'T->'U), _mthd: Default2) = IReadOnlyDictionary.map f x : IReadOnlyDictionary<'Key,_>
134+
static member Map ((x: IReadOnlyDictionary<_,_>, f: 'T->'U), _mthd: Default2) : IReadOnlyDictionary<'Key,_> = IReadOnlyDictionary.mapValues f x
133135
static member Map ((x: IObservable<'T> , f: 'T->'U), _mthd: Default2) = Observable.map f x : IObservable<'U>
134136
#if !FABLE_COMPILER
135137
static member Map ((x: Nullable<_> , f: 'T->'U), _mthd: Default2) = Nullable.map f x : Nullable<'U>

0 commit comments

Comments
 (0)