Skip to content

Commit 809178a

Browse files
committed
Merge branch 'master' into gus/fsharp9
2 parents e213a85 + c77dde1 commit 809178a

File tree

8 files changed

+25
-22
lines changed

8 files changed

+25
-22
lines changed

.github/workflows/dotnetcore.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ on:
1414
jobs:
1515
build:
1616

17-
runs-on: windows-latest
17+
runs-on: ubuntu-latest
1818

1919
steps:
2020
- uses: actions/checkout@v2
@@ -25,7 +25,6 @@ jobs:
2525
10.0.x
2626
9.0.x
2727
8.0.x
28-
7.0.x
2928
- name: Restore
3029
run: git submodule update --init --recursive
3130
- name: Build with dotnet
@@ -38,7 +37,7 @@ jobs:
3837
run: dotnet test build.proj -v n
3938

4039
package:
41-
runs-on: windows-latest
40+
runs-on: ubuntu-latest
4241
permissions:
4342
packages: write
4443
contents: read
@@ -51,7 +50,6 @@ jobs:
5150
10.0.x
5251
9.0.x
5352
8.0.x
54-
7.0.x
5553
6.0.x
5654
- name: Restore
5755
run: git submodule update --init --recursive

.github/workflows/fable.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ jobs:
2222
with:
2323
dotnet-version: |
2424
8.0.x
25-
7.0.x
2625
6.0.x
2726
- name: Restore tools
2827
run: dotnet tool restore

.github/workflows/release-package.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ on:
1111
tags: ['v**']
1212
jobs:
1313
package:
14-
runs-on: windows-latest
14+
runs-on: ubuntu-latest
1515
permissions:
1616
packages: write
1717
contents: read
@@ -22,7 +22,6 @@ jobs:
2222
with:
2323
dotnet-version: |
2424
8.0.x
25-
7.0.x
2625
6.0.x
2726
- name: Restore
2827
run: git submodule update --init --recursive

global.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@
66
},
77

88
"additionalSdks": [
9-
"5.0.405",
109
"6.0.201",
11-
"7.0.100",
1210
"8.0.100"
1311
]
1412
}

src/FSharpPlus/Builders.fs

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -254,13 +254,22 @@ module GenericBuilders =
254254
/// Creates a (sequential) applicative computation expression which compose effects of three Applicatives.
255255
let applicative3<'``Applicative1<Applicative2<Applicative3<'T>>>``> = ApplicativeBuilder3<'``Applicative1<Applicative2<Applicative3<'T>>>``> ()
256256

257-
/// Creates a (non sequential) applicative computation expression.
257+
[<ObsoleteAttribute("This value is obsolete. Use zapp instead.", false)>]
258258
let applicative'<'``ZipApplicative<'T>``> = ZipApplicativeBuilder<'``ZipApplicative<'T>``> ()
259259

260-
/// Creates a (non sequential) applicative computation expression which compose effects of two Applicatives.
260+
[<ObsoleteAttribute("This value is obsolete. Use zapp2 instead.", false)>]
261261
let applicative2'<'``ZipApplicative1<ZipApplicative2<'T>>``> = ZipApplicativeBuilder2<'``ZipApplicative1<ZipApplicative2<'T>>``> ()
262262

263-
/// Creates a (non sequential) applicative computation expression which compose effects of three Applicatives.
263+
[<ObsoleteAttribute("This value is obsolete. Use zapp3 instead.", false)>]
264264
let applicative3'<'``Applicative1<Applicative2<Applicative3<'T>>>``> = ZipApplicativeBuilder3<'``Applicative1<Applicative2<Applicative3<'T>>>``> ()
265265

266+
/// Creates a (non sequential) applicative computation expression.
267+
let zapp<'``ZipApplicative<'T>``> = ZipApplicativeBuilder<'``ZipApplicative<'T>``> ()
268+
269+
/// Creates a (non sequential) applicative computation expression which compose effects of two Applicatives.
270+
let zapp2<'``ZipApplicative1<ZipApplicative2<'T>>``> = ZipApplicativeBuilder2<'``ZipApplicative1<ZipApplicative2<'T>>``> ()
271+
272+
/// Creates a (non sequential) applicative computation expression which compose effects of three Applicatives.
273+
let zapp3<'``ZipApplicative1<ZipApplicative2<ZipApplicative3<'T>>>``> = ZipApplicativeBuilder3<'``ZipApplicative1<ZipApplicative2<ZipApplicative3<'T>>>``> ()
274+
266275
#endif

src/FSharpPlus/Data/Free.fs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,14 @@ module Free =
3333
| Free.Pure x -> Choice1Of2 x
3434
| Free.Roll x -> let x = unbox x in Choice2Of2 x
3535

36-
let inline map f x =
36+
let inline map ([<InlineIfLambda>]f) x =
3737
let rec loop (f: 'T->'U) (x: Free<'``Functor<'T>``,'T>) : Free<'``Functor<'U>``,'U> =
3838
match run x with
3939
| Pure x -> Pure (f x)
4040
| Roll (x: ^``Functor<Free<'Functor<'T>,'T>>``) -> Roll (Map.Invoke (loop f : Free<'``Functor<'T>``,'T> -> _) x: ^``Functor<Free<'Functor<'U>,'U>>``)
4141
loop f x
4242

43-
let inline bind (f: 'T -> Free<'``Functor<'U>``,'U>) (x: Free<'``Functor<'T>``,'T>) : Free<'``Functor<'U>``,'U> =
43+
let inline bind ([<InlineIfLambda>]f: 'T -> Free<'``Functor<'U>``,'U>) (x: Free<'``Functor<'T>``,'T>) : Free<'``Functor<'U>``,'U> =
4444
let rec loop f (x: Free<_,_>) =
4545
match run x with
4646
| Pure r -> f r
@@ -54,30 +54,30 @@ module Free =
5454
| Roll (f: ^``Functor<Free<'Functor<'T->'U>,'T->'U>>``) -> Roll (Map.Invoke (loop x: Free<'``Functor<'T->'U>``,'T->'U> -> _) f: '``Functor<Free<'Functor<'U>,'U>>``)
5555
loop x f
5656

57-
let inline map2 (f: 'T->'U->'V) (x: Free<'``Functor<'T>``,'T>) (y: Free<'``Functor<'U>``,'U>) : Free<'``Functor<'V>``,'V> =
57+
let inline map2 ([<InlineIfLambda>]f: 'T->'U->'V) (x: Free<'``Functor<'T>``,'T>) (y: Free<'``Functor<'U>``,'U>) : Free<'``Functor<'V>``,'V> =
5858
let rec loop (y: Free<_,_>) (x: Free<_,_>) =
5959
match run x with
6060
| Pure x -> map<'U,'V,'``Functor<'U>``,'``Functor<Free<'Functor<'U>,'U>>``,'``Functor<Free<'Functor<'V>,'V>>``,'``Functor<'V>``> (f x) y : Free<'``Functor<'V>``,'V>
6161
| Roll (x: ^``Functor<Free<'Functor<'T>,'T>>``) -> Roll (Map.Invoke (loop y: Free<'``Functor<'T>``,'T> -> _) x: '``Functor<Free<'Functor<'V>,'V>>``)
6262
loop y x
6363

64-
let inline map3 (f: 'T->'U->'V->'W) (x: Free<'``Functor<'T>``,'T>) (y: Free<'``Functor<'U>``,'U>) (z: Free<'``Functor<'V>``,'V>) : Free<'``Functor<'W>``,'W> =
64+
let inline map3 ([<InlineIfLambda>]f: 'T->'U->'V->'W) (x: Free<'``Functor<'T>``,'T>) (y: Free<'``Functor<'U>``,'U>) (z: Free<'``Functor<'V>``,'V>) : Free<'``Functor<'W>``,'W> =
6565
let rec loop (y: Free<_,_>) (z: Free<_,_>) (x: Free<_,_>) =
6666
match run x with
6767
| Pure x -> map2<'U,'V,'W,'``Functor<'U>``,'``Functor<Free<'Functor<'U>,'U>>``,'``Functor<Free<'Functor<'W>,'W>>``,'``Functor<Free<'Functor<'V>,'V>>``,'``Functor<'V>``,'``Functor<'W>``> (f x) y z : Free<'``Functor<'W>``,'W>
6868
| Roll (x: ^``Functor<Free<'Functor<'T>,'T>>``) -> Roll (Map.Invoke (loop y z: Free<'``Functor<'T>``,'T> -> _) x: '``Functor<Free<'Functor<'W>,'W>>``)
6969
loop y z x
7070

7171
/// Folds the Free structure into a Monad
72-
let inline fold (f: '``Functor<'T>`` -> '``Monad<'T>``) (x: Free<'``Functor<'U>``,'U>) : '``Monad<'U>`` =
72+
let inline fold ([<InlineIfLambda>]f: '``Functor<'T>`` -> '``Monad<'T>``) (x: Free<'``Functor<'U>``,'U>) : '``Monad<'U>`` =
7373
let rec loop f x =
7474
match run x with
7575
| Pure a -> Return.Invoke a
7676
| Roll x -> f x >>= loop f
7777
loop f x
7878

7979
/// Tear down a Free monad using iteration.
80-
let inline iterM (f: '``Functor<'Monad<'T>>`` -> '``Monad<'T>``) (x: Free<'``Functor<'T>``,'T>) : '``Monad<'T>`` =
80+
let inline iterM ([<InlineIfLambda>]f: '``Functor<'Monad<'T>>`` -> '``Monad<'T>``) (x: Free<'``Functor<'T>``,'T>) : '``Monad<'T>`` =
8181
let rec loop f x =
8282
match run x with
8383
| Pure x -> Return.Invoke x
@@ -88,7 +88,7 @@ module Free =
8888
let inline liftF (x: '``Functor<'T>``) : Free<'``Functor<'T>``,'T> = Roll (Map.Invoke (Pure: 'T -> Free<'``Functor<'T>``,'T>) x : '``Functor<Free<'Functor<'T>,'T>>``)
8989

9090
/// Lift a natural transformation from functor F to functor G into a natural transformation from Free of F to Free of G.
91-
let inline hoist (f: ^``F<Free<'F<'T>, 'T>>`` -> ^``G<Free<'F<'T>, 'T>>``) (x: Free<'``F<'T>``, 'T>) : Free<'``G<'T>``, 'T> =
91+
let inline hoist ([<InlineIfLambda>]f: ^``F<Free<'F<'T>, 'T>>`` -> ^``G<Free<'F<'T>, 'T>>``) (x: Free<'``F<'T>``, 'T>) : Free<'``G<'T>``, 'T> =
9292
let rec loop f x =
9393
if opaqueId false then
9494
let _: '``G<Free<'F<'T>, 'T>>`` = Map.Invoke Unchecked.defaultof<Free<'``G<'T>``, 'T> -> Free<'``F<'T>``, 'T>> Unchecked.defaultof<'``G<Free<'G<'T>, 'T>>``>

src/FSharpPlus/Extensions/Task.fs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -398,8 +398,8 @@ module Task =
398398
let result value = Task.FromResult value
399399

400400
/// Raises an exception in the Task
401-
let raise (e: exn) =
402-
let tcs = TaskCompletionSource<'U> ()
401+
let raise<'T> (e: exn) =
402+
let tcs = TaskCompletionSource<'T> ()
403403
tcs.SetException e
404404
tcs.Task
405405
#endif

tests/FSharpPlus.Tests/Applicatives.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ module Applicatives =
2020

2121
[<Test>]
2222
let zipApply () =
23-
let arr1 = applicative2' {
23+
let arr1 = zapp2 {
2424
let! x1 = async { return [|1; 2; 3|] }
2525
and! x2 = async { return [|10; 20; 30|] }
2626
and! x3 = async { return [|100; 200; 300|] }

0 commit comments

Comments
 (0)