File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed
Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff 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
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments