From b5b7c49887a82f80c04f6da852150e7486915c11 Mon Sep 17 00:00:00 2001 From: Oskar Gewalli Date: Fri, 2 Sep 2022 19:38:32 +0200 Subject: [PATCH 1/5] Release docs build target --- .github/workflows/dotnetcore.yml | 4 ---- build.proj | 10 ++++++++++ 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/.github/workflows/dotnetcore.yml b/.github/workflows/dotnetcore.yml index 4e1d6979b..52521f674 100644 --- a/.github/workflows/dotnetcore.yml +++ b/.github/workflows/dotnetcore.yml @@ -82,10 +82,6 @@ jobs: uses: actions/setup-dotnet@v1 with: dotnet-version: 6.0.201 - - name: Setup .NET Core 5 - uses: actions/setup-dotnet@v1 - with: - dotnet-version: 5.0.405 - name: Restore run: git submodule update --init --recursive - name: Build All Docs diff --git a/build.proj b/build.proj index 9ee435d44..2f1f16eee 100644 --- a/build.proj +++ b/build.proj @@ -20,12 +20,22 @@ + + + + + + + + + + From f9062b298c81abd36a3f3464b579f90ef7e41fd9 Mon Sep 17 00:00:00 2001 From: Oskar Gewalli Date: Fri, 2 Sep 2022 19:56:16 +0200 Subject: [PATCH 2/5] Revert removal of .net 5 --- .github/workflows/dotnetcore.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/dotnetcore.yml b/.github/workflows/dotnetcore.yml index 52521f674..d7e9fe773 100644 --- a/.github/workflows/dotnetcore.yml +++ b/.github/workflows/dotnetcore.yml @@ -82,6 +82,10 @@ jobs: uses: actions/setup-dotnet@v1 with: dotnet-version: 6.0.201 + - name: Setup .NET Core 5 + uses: actions/setup-dotnet@v1 + with: + dotnet-version: 5.0.405 - name: Restore run: git submodule update --init --recursive - name: Build All Docs From 48e30fbbc8d50882fb3bc361e89f1e45058db4ee Mon Sep 17 00:00:00 2001 From: Oskar Gewalli Date: Fri, 2 Sep 2022 19:57:05 +0200 Subject: [PATCH 3/5] Smaller diff --- .github/workflows/dotnetcore.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/dotnetcore.yml b/.github/workflows/dotnetcore.yml index d7e9fe773..4e1d6979b 100644 --- a/.github/workflows/dotnetcore.yml +++ b/.github/workflows/dotnetcore.yml @@ -83,9 +83,9 @@ jobs: with: dotnet-version: 6.0.201 - name: Setup .NET Core 5 - uses: actions/setup-dotnet@v1 - with: - dotnet-version: 5.0.405 + uses: actions/setup-dotnet@v1 + with: + dotnet-version: 5.0.405 - name: Restore run: git submodule update --init --recursive - name: Build All Docs From eb3eaf455e4cafb18869cf3202993dcc9970e94e Mon Sep 17 00:00:00 2001 From: Oskar Gewalli Date: Fri, 2 Sep 2022 20:24:06 +0200 Subject: [PATCH 4/5] Use github.com/fdcastel/Ps.cmd wrapper --- docsrc/tools/download_nugets.cmd | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docsrc/tools/download_nugets.cmd b/docsrc/tools/download_nugets.cmd index 76f0948f9..6b4bff1c0 100644 --- a/docsrc/tools/download_nugets.cmd +++ b/docsrc/tools/download_nugets.cmd @@ -1,2 +1 @@ -@ECHO OFF -PowerShell.exe -Command "& '%~dpn0.ps1'" \ No newline at end of file +@%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy Bypass -Command "try { & '%~dpn0.ps1' %*; $err = -not $? } catch { Write-Host $_; $err = $true; $LastExitCode = 1 }; if ($err) { $ppid = (gwmi Win32_Process -Filter processid=$pid).ParentProcessId; $cl = (gwmi Win32_Process -Filter processid=$ppid).CommandLine; if ($cl -like '*cmd.exe /c*') { $gppid = (gwmi Win32_Process -Filter processid=$ppid).ParentProcessId; $pn = (gps -id $gppid).ProcessName; if ($pn -eq 'explorer') { pause } } }; exit $LastExitCode" \ No newline at end of file From 460c26e118f42296751213d6343ce117a9082999 Mon Sep 17 00:00:00 2001 From: Gusty <1261319+gusty@users.noreply.github.com> Date: Wed, 7 Sep 2022 23:56:16 +0200 Subject: [PATCH 5/5] Initial implementation --- src/FSharpPlus/Control/Applicative.fs | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/FSharpPlus/Control/Applicative.fs b/src/FSharpPlus/Control/Applicative.fs index 400a3cef6..b3eb2150a 100644 --- a/src/FSharpPlus/Control/Applicative.fs +++ b/src/FSharpPlus/Control/Applicative.fs @@ -143,6 +143,9 @@ type Lift3 with static member inline Lift3 (_, (_:'t when 't: null and 't: struct, _: ^u when ^u : null and ^u: struct, _: ^v when ^v : null and ^v: struct), _mthd: Default1) = id static member inline Lift3 (f: 'T -> 'U -> 'V -> 'W, (x: '``Applicative<'T>``, y: '``Applicative<'U>``, z: '``Applicative<'V>``) , _mthd: Default1) = ((^``Applicative<'T>`` or ^``Applicative<'U>`` or ^``Applicative<'V>`` ) : (static member Lift3 : _*_*_*_ -> _) f, x, y, z) + +open System.Reflection + type IsLeftZero = inherit Default1 @@ -155,9 +158,17 @@ type IsLeftZero = static member IsLeftZero (t: ref> , _mthd: IsLeftZero) = match t.Value with Choice2Of2 _ -> true | _ -> false static member inline Invoke (x: '``Applicative<'T>``) : bool = - let inline call (mthd : ^M, input: ^I) = - ((^M or ^I) : (static member IsLeftZero : _*_ -> _) ref input, mthd) - call(Unchecked.defaultof, x) + + let ty = typeof + let mi = ty.GetMethod ("IsLeftZero", [|typeof``>>; ty|]) + if not (isNull mi) then mi.Invoke (null, [|box x|]) |> FSharpPlus.Internals.Prelude.retype + else + let ty = typeof<'``Applicative<'T>``> + let mi = ty.GetMethod ("IsLeftZero", [|ty|]) + if isNull mi then false + else + mi.Invoke (null, [|box x|]) + |> FSharpPlus.Internals.Prelude.retype static member inline InvokeOnInstance (x: '``Applicative<'T>``) : bool = ((^``Applicative<'T>``) : (static member IsLeftZero : _ -> _) x)