Skip to content

Commit a073207

Browse files
committed
fix Result.isOk
1 parent 39d0064 commit a073207

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/FSharpPlus/Control/Foldable.fs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,11 @@ type Length =
425425
static member Length (x: 'T list , [<Optional>]_impl: Length ) = List.length x
426426
static member Length (x: option<'T> , [<Optional>]_impl: Length ) = if x.IsSome then 1 else 0
427427
static member Length (x: voption<'T> , [<Optional>]_impl: Length ) = if x.IsSome then 1 else 0
428+
#if !NET45
428429
static member Length (x: Result<_, _> , [<Optional>]_impl: Length ) = if Result.isOk x then 1 else 0
430+
#else
431+
static member Length (x: Result<_, _> , [<Optional>]_impl: Length ) = match x with | Ok _ -> 1 | _ -> 0
432+
#endif
429433
static member Length (x: 'T [] , [<Optional>]_impl: Length ) = Array.length x
430434
[<Obsolete;CompiledName("Length")>]
431435
static member LengthLegacy (x:seq<'T> , [<Optional>]_impl:Length) = Seq.length x

0 commit comments

Comments
 (0)