Skip to content

Commit

Permalink
#IF NET45 ...
Browse files Browse the repository at this point in the history
  • Loading branch information
wallymathieu committed Nov 11, 2024
1 parent 90ec780 commit 617c009
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/FSharpPlus/Control/Functor.fs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions src/FSharpPlus/Extensions/ResizeArray.fs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ module ResizeArray =
/// <param name="action">The function to apply to elements from the input ResizeArray.</param>
/// <param name="source">The input ResizeArray.</param>
let iter (action: 'T -> 'U) (source: ResizeArray<'T>) =
#if !NET45
raiseIfNull (nameof source) source
#endif

ResizeArray (Seq.map action source)

Expand Down

0 comments on commit 617c009

Please sign in to comment.