Skip to content

Commit 617c009

Browse files
committed
#IF NET45 ...
1 parent 90ec780 commit 617c009

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

src/FSharpPlus/Control/Functor.fs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,14 @@ type Iterate =
4141
#else
4242
static member Iterate (x: Async<'T> , action: 'T -> unit) = (x |> Async.map action |> Async.AsTask).Wait ()
4343
#endif
44-
static member Iterate (x: Result<'T, 'E> , action) = Result.iter action x
44+
static member Iterate (x: Result<'T, 'E> , action) =
45+
#if !NET45
46+
Result.iter action x
47+
#else
48+
match x with
49+
| Error _ -> ()
50+
| Ok value -> action value
51+
#endif
4552
static member Iterate (x: Choice<'T, 'E> , action) = match x with Choice1Of2 x -> action x | _ -> ()
4653
static member Iterate (KeyValue(_: 'Key, x: 'T), action) = action x : unit
4754
static member Iterate (x: Map<'Key,'T> , action) = Map.iter (const' action) x

src/FSharpPlus/Extensions/ResizeArray.fs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@ module ResizeArray =
2727
/// <param name="action">The function to apply to elements from the input ResizeArray.</param>
2828
/// <param name="source">The input ResizeArray.</param>
2929
let iter (action: 'T -> 'U) (source: ResizeArray<'T>) =
30+
#if !NET45
3031
raiseIfNull (nameof source) source
32+
#endif
3133

3234
ResizeArray (Seq.map action source)
3335

0 commit comments

Comments
 (0)