Skip to content

Commit 1798144

Browse files
committed
Merge branch 'master' into v1.4
2 parents b8b6d5f + 3d54f0f commit 1798144

24 files changed

+248
-122
lines changed

.config/dotnet-tools.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
]
1010
},
1111
"fsdocs-tool": {
12-
"version": "16.1.1",
12+
"version": "17.2.3",
1313
"commands": [
1414
"fsdocs"
1515
]

.github/workflows/dotnetcore.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ env:
88
# GitHub Packages Feed settings
99
GITHUB_FEED: https://nuget.pkg.github.com/fsprojects
1010
GITHUB_USER: fsprojects
11-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
11+
#GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1212

1313
on:
1414
push:
@@ -66,13 +66,13 @@ jobs:
6666
with:
6767
name: nupkg
6868
path: ./bin/nupkg/*.nupkg
69-
- name: Push to GitHub Feed
70-
shell: bash
71-
run: |
72-
for f in ./bin/nupkg/*.nupkg
73-
do
74-
curl -vX PUT -u "$GITHUB_USER:$GITHUB_TOKEN" -F package=@$f $GITHUB_FEED
75-
done
69+
#- name: Push to GitHub Feed
70+
# shell: bash
71+
# run: |
72+
# for f in ./bin/nupkg/*.nupkg
73+
# do
74+
# curl -vX PUT -u "$GITHUB_USER:$GITHUB_TOKEN" -F package=@$f $GITHUB_FEED
75+
# done
7676

7777
docs:
7878
runs-on: windows-latest

.github/workflows/fable.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ jobs:
2121
run: git submodule update --init --recursive
2222
- name: Restore tools
2323
run: dotnet tool restore
24+
- name: Install fable
25+
run: dotnet tool install --global Fable --version 3.7.20
2426
- name: Use Node.js
2527
uses: actions/setup-node@v1
2628
with:
@@ -30,7 +32,7 @@ jobs:
3032
run: npm install
3133
- name: Run Fable tests
3234
working-directory: tests/FSharpPlusFable.Tests
33-
run: dotnet fable . --outDir bin --runScript ./bin
35+
run: fable . --outDir bin --runScript ./bin
3436

3537
testFable3SubsetOnCore:
3638
runs-on: ubuntu-latest

docsrc/content/abstraction-alternative.fsx

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,16 @@ Applicative Functors which also have a monoid structure.
1010
___
1111
Minimal complete definition
1212
---------------------------
13-
* ``return x``/``result x``
13+
* ``return x``   /   ``result x``
1414
* ``(<*>) f x``
1515
* ``empty``
16-
* ``append x y``/``(<|>) x y``
16+
* ``append x y`` &nbsp; / &nbsp; ``(<|>) x y``
1717
*)
1818
(**
19-
static member Return (x:'T) : 'Alternative<'T>
20-
static member (<*>) (f:'T->'U, x:Alternative<'T>) : Alternative<'U>
21-
static member get_Empty () :'Alternative
22-
static member (<|>) (x:'Alternative<'T>, y:'Alternative<'T>) :'Alternative<'T>
19+
static member Return (x: 'T) : 'Alternative<'T>
20+
static member (<*>) (f: 'T -> 'U, x: 'Alternative<'T>) : 'Alternative<'U>
21+
static member get_Empty () : 'Alternative
22+
static member (<|>) (x: 'Alternative<'T>, y: 'Alternative<'T>) : 'Alternative<'T>
2323
*)
2424
(**
2525
Note: ``return`` can't be used outside computation expressions, use ``result`` instead.
@@ -28,11 +28,14 @@ Other operations
2828
* ``mfilter``
2929
*)
3030
(**
31-
static member MFilter (x:seq<'Alternative>) :'Alternative
31+
static member MFilter (x: seq<'Alternative>) : 'Alternative
3232
*)
3333
(**
3434
* ``choice``
3535
*)
36+
(**
37+
static member inline Choice (source: 'Foldable<'Alt<'T>>) : 'Alt<'T>
38+
*)
3639
(**
3740
Rules
3841
-----
@@ -56,13 +59,16 @@ Concrete implementations
5659
From .Net/F#
5760
5861
- ``list<'T>``
59-
- ``option<'T>``
6062
- ``array<'T>``
6163
- ``seq<'T>``
64+
- ``option<'T>``
65+
- ``voption<'T>``
66+
- ``Result<'T, 'Monoid>``
67+
- ``Choice<'T, 'Monoid>``
6268
- ``'T -> 'Alternative``
63-
69+
6470
From F#+
65-
71+
6672
- [``ReaderT<'R, 'MonadPlus<'T>>``](type-readert.html)
6773
- [``WriterT<'MonadPlus<'T * 'Monoid>>``](type-writert.html)
6874
- [``StateT<'S,'MonadPlus<'T * 'S>>``](type-statet.html)
@@ -73,7 +79,12 @@ From F#+
7379
- [``Compose<'AlternativeF<'AlternativeG<'T>>>``](type-compose.html)
7480
- [``DList<'T>``](type-dlist.html)
7581
- [``ZipList<'S>``](type-ziplist.html)
76-
82+
- [``NonEmptySeq<'T>``](type-nonemptyseq.html) ``*``
83+
- [``Validation<'Error, 'T>``](type-validation.html) ``*``
84+
85+
``*`` Only ``<|>`` operation
86+
87+
7788
[Suggest another](https://github.com/fsprojects/FSharpPlus/issues/new) concrete implementation
7889
7990
Examples

docsrc/content/abstraction-applicative.fsx

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ A functor with application, providing operations to embed pure expressions (``re
1010
___
1111
Minimal complete definition
1212
---------------------------
13-
* ``return x``/``result x``
13+
* ``return x`` &nbsp; / &nbsp; ``result x``
1414
* ``(<*>) f x``
1515
*)
1616
(**
17-
static member Return (x:'T) : 'Applicative<'T>
18-
static member (<*>) (f: 'Applicative<'T->'U>, x: 'Applicative<'T>) : 'Applicative<'U>
17+
static member Return (x: 'T) : 'Applicative<'T>
18+
static member (<*>) (f: 'Applicative<'T -> 'U>, x: 'Applicative<'T>) : 'Applicative<'U>
1919
*)
2020
(**
2121
Note: ``return`` can't be used outside computation expressions, use ``result`` instead.
@@ -27,7 +27,7 @@ Other operations
2727
* ``lift2``
2828
*)
2929
(**
30-
static member Lift2 (f: 'T1->'T2->'T, x1: 'Applicative<'T1>, x2: 'Applicative<'T2>) : 'Applicative<'T>
30+
static member Lift2 (f: 'T1 -> 'T2 -> 'T, x1: 'Applicative<'T1>, x2: 'Applicative<'T2>) : 'Applicative<'T>
3131
*)
3232
(**
3333
@@ -131,13 +131,13 @@ open FSharpPlus
131131
open FSharpPlus.Data
132132

133133
// Apply +4 to a list
134-
let lst5n6 = map ((+) 4) [ 1;2 ]
134+
let lst5n6 = map ((+) 4) [ 1; 2 ]
135135

136136
// Apply +4 to an array
137-
let arr5n6 = map ((+) 4) [|1;2|]
137+
let arr5n6 = map ((+) 4) [|1; 2|]
138138

139139
// I could have written this
140-
let arr5n6' = (+) <!> [|4|] <*> [|1;2|]
140+
let arr5n6' = (+) <!> [|4|] <*> [|1; 2|]
141141

142142
// Add two options
143143
let opt120 = (+) <!> Some 20 <*> tryParse "100"
@@ -198,7 +198,7 @@ open FSharpPlus.Math.Applicative
198198
let opt121' = Some 21 .+. tryParse "100"
199199
let optTrue = 30 >. tryParse "29"
200200
let optFalse = tryParse "30" .< 29
201-
let m1m2m3 = -.[1;2;3]
201+
let m1m2m3 = -.[1; 2; 3]
202202

203203

204204
// Using applicative computation expression
@@ -245,7 +245,17 @@ let person6 = applicative2 {
245245
// A Monad is automatically an Applicative
246246

247247
type MyList<'s> = MyList of 's seq with
248-
static member Return (x:'a) = MyList (Seq.singleton x)
248+
static member Return (x: 'a) = MyList (Seq.singleton x)
249249
static member (>>=) (MyList x: MyList<'T>, f) = MyList (Seq.collect (f >> (fun (MyList x) -> x)) x)
250250

251-
let mappedMyList : MyList<_> = (MyList [(+) 1;(+) 2;(+) 3]) <*> (MyList [1;2;3])
251+
let mappedMyList : MyList<_> = (MyList [(+) 1; (+) 2; (+) 3]) <*> (MyList [1; 2; 3])
252+
253+
254+
(**
255+
Recommended reading
256+
-------------------
257+
258+
- Highly recommended Matt Thornton's blog [Grokking Applicatives](https://dev.to/choc13/grokking-applicatives-44o1).
259+
It contains examples using F#+ and an explanation from scratch.
260+
261+
*)

docsrc/content/abstraction-bifoldable.fsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,14 +79,14 @@ From .Net/F#
7979
8080
- ``'T * 'U``
8181
- ``struct ('T * 'U)``
82-
- ``Result<'T,'U>``
83-
- ``Choice<'T,'U>``
82+
- ``Result<'T, 'U>``
83+
- ``Choice<'T, 'U>``
8484
8585
8686
From F#+
8787
88-
- [``Const<'C,'T>``](type-const.html)
89-
- [``Validation<'err,'a>``](type-validation.html)
88+
- [``Const<'C, 'T>``](type-const.html)
89+
- [``Validation<'Error, 'T>``](type-validation.html)
9090
9191
[Suggest another](https://github.com/fsprojects/FSharpPlus/issues/new) concrete implementation
9292

docsrc/content/abstraction-bifunctor.fsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,15 +68,15 @@ From .Net/F#
6868
6969
- ``'T1 * 'T2``
7070
- ``struct ('T1 * 'T2)``
71-
- ``Result<'T2,'T1>``
72-
- ``Choice<'T2,'T1>``
73-
- ``KeyValuePair<'T1,'T2>``
71+
- ``Result<'T2, 'T1>``
72+
- ``Choice<'T2, 'T1>``
73+
- ``KeyValuePair<'T1, 'T2>``
7474
7575
7676
From F#+
7777
78-
- [``Const<'C,'T>``](type-const.html)
79-
- [``Validation<'Error,'T>``](type-validation.html)
78+
- [``Const<'C, 'T>``](type-const.html)
79+
- [``Validation<'Error, 'T>``](type-validation.html)
8080
8181
[Suggest another](https://github.com/fsprojects/FSharpPlus/issues/new) concrete implementation
8282

docsrc/content/abstraction-bitraversable.fsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,14 @@ From .Net/F#
5454
5555
- ``'T * 'U``
5656
- ``struct ('T * 'U)``
57-
- ``Result<'T,'U>``
58-
- ``Choice<'T,'U>``
57+
- ``Result<'T, 'U>``
58+
- ``Choice<'T, 'U>``
5959
6060
6161
From F#+
6262
63-
- [``Const<'C,'T>``](type-const.html)
64-
- [``Validation<'Error,'T>``](type-validation.html)
63+
- [``Const<'C, 'T>``](type-const.html)
64+
- [``Validation<'Error, 'T>``](type-validation.html)
6565
6666
6767
[Suggest another](https://github.com/fsprojects/FSharpPlus/issues/new) concrete implementation

docsrc/content/abstraction-category.fsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ Concrete implementations
5555
5656
From .Net/F#
5757
58-
- ``'T->'U``
59-
- ``Func<'T,'U>``
58+
- ``'T -> 'U``
59+
- ``Func<'T, 'U>``
6060
6161
6262
From F#+

0 commit comments

Comments
 (0)