diff --git a/src/FSharpPlus/Control/Functor.fs b/src/FSharpPlus/Control/Functor.fs index 5622c4a9c..43c9cba4b 100644 --- a/src/FSharpPlus/Control/Functor.fs +++ b/src/FSharpPlus/Control/Functor.fs @@ -41,7 +41,14 @@ type Iterate = #else static member Iterate (x: Async<'T> , action: 'T -> unit) = (x |> Async.map action |> Async.AsTask).Wait () #endif - static member Iterate (x: Result<'T, 'E> , action) = Result.iter action x + static member Iterate (x: Result<'T, 'E> , action) = + #if !NET45 + Result.iter action x + #else + match x with + | Error _ -> () + | Ok value -> action value + #endif static member Iterate (x: Choice<'T, 'E> , action) = match x with Choice1Of2 x -> action x | _ -> () static member Iterate (KeyValue(_: 'Key, x: 'T), action) = action x : unit static member Iterate (x: Map<'Key,'T> , action) = Map.iter (const' action) x diff --git a/src/FSharpPlus/Extensions/ResizeArray.fs b/src/FSharpPlus/Extensions/ResizeArray.fs index 28364353b..c00370291 100644 --- a/src/FSharpPlus/Extensions/ResizeArray.fs +++ b/src/FSharpPlus/Extensions/ResizeArray.fs @@ -27,7 +27,9 @@ module ResizeArray = /// The function to apply to elements from the input ResizeArray. /// The input ResizeArray. let iter (action: 'T -> 'U) (source: ResizeArray<'T>) = + #if !NET45 raiseIfNull (nameof source) source + #endif ResizeArray (Seq.map action source)