Skip to content

Commit 14e3ab9

Browse files
committed
Merge branch 'master' into v1.6
2 parents e1b54a1 + 30d990e commit 14e3ab9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+3723
-331
lines changed

.github/workflows/dotnetcore.yml

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,6 @@ env:
55
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
66
# Disable sending usage data to Microsoft
77
DOTNET_CLI_TELEMETRY_OPTOUT: true
8-
# GitHub Packages Feed settings
9-
GITHUB_FEED: https://nuget.pkg.github.com/fsprojects
10-
GITHUB_USER: fsprojects
11-
#GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
128

139
on:
1410
push:
@@ -40,7 +36,9 @@ jobs:
4036

4137
package:
4238
runs-on: windows-latest
43-
39+
permissions:
40+
packages: write
41+
contents: read
4442
steps:
4543
- uses: actions/checkout@v2
4644
- name: Setup .NET Core
@@ -71,13 +69,14 @@ jobs:
7169
with:
7270
name: nupkg
7371
path: ./bin/nupkg/*.nupkg
74-
#- name: Push to GitHub Feed
75-
# shell: bash
76-
# run: |
77-
# for f in ./bin/nupkg/*.nupkg
78-
# do
79-
# curl -vX PUT -u "$GITHUB_USER:$GITHUB_TOKEN" -F package=@$f $GITHUB_FEED
80-
# done
72+
- name: Push to GitHub Feed
73+
shell: bash
74+
run: |
75+
for f in ./bin/nupkg/*.nupkg
76+
do
77+
echo $f
78+
dotnet nuget push $f -k ${{ secrets.GITHUB_TOKEN }} -s https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json
79+
done
8180
8281
docs:
8382
runs-on: windows-latest

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# FSharpPlus
22

3-
[![Build Status](https://ci.appveyor.com/api/projects/status/25ukpc0lamyf7pdx/branch/master?svg=true)](https://ci.appveyor.com/project/wallymathieu/fsharpplus/branch/master)
43
[![Download](https://img.shields.io/nuget/dt/FSharpPlus.svg)](https://www.nuget.org/packages/FSharpPlus)
54
[![NuGet](https://img.shields.io/nuget/v/FSharpPlus.svg)](https://www.nuget.org/packages/FSharpPlus)
65
[![NuGet Preview](https://img.shields.io/nuget/vpre/FSharpPlus.svg?label=pre)](https://www.nuget.org/packages/FSharpPlus/absoluteLatest)

appveyor.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ install:
1717
- cmd: git submodule update --init --recursive
1818
build_script:
1919
- cmd: dotnet restore ./FSharpPlus.sln
20-
- cmd: dotnet build -c Release ./FSharpPlus.sln
21-
- cmd: dotnet test -f net6.0 -c Test tests/FSharpPlus.Tests
20+
#- cmd: dotnet build -c Release ./FSharpPlus.sln
21+
- cmd: dotnet test -c Test tests/FSharpPlus.Tests
2222
- ps: if ($env:VersionSuffix) { dotnet pack build.proj --version-suffix $env:VersionSuffix } else { dotnet pack build.proj }
2323
test: off
2424
artifacts:

docsrc/content/abstraction-traversable.fsx

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,20 @@ Minimal complete definition
2121
* ``traverse f x`` | ``sequence x``
2222
*)
2323
(**
24-
static member Traverse (t:'Traversable<'T>, f: 'T -> 'Functor<'U>) : 'Functor<'Traversable<'U>>
25-
static member Sequence (t:'Traversable<'Functor<'T>>) : 'Functor<'Traversable<'T>>
24+
static member Traverse (t: 'Traversable<'T>, f: 'T -> 'Applicative<'U>) : 'Applicative<'Traversable<'U>>
25+
static member Sequence (t: 'Traversable<'Applicative<'T>>) : 'Applicative<'Traversable<'T>>
26+
*)
27+
(**
28+
29+
30+
Other operations
31+
----------------
32+
33+
* ``gather f x`` | ``transpose x`` (same as traverse and sequence but operating on ZipApplicatives)
34+
*)
35+
(**
36+
static member Gather (t: 'Traversable<'T>, f: 'T -> 'ZipApplicative<'U>) : 'ZipApplicative<'Traversable<'U>>
37+
static member Transpose (t: 'Traversable<'ZipApplicative<'T>>) : 'ZipApplicative<'Traversable<'T>>
2638
*)
2739
(**
2840
Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
(*** hide ***)
2+
// This block of code is omitted in the generated HTML documentation. Use
3+
// it to define helpers that you do not want to show in the documentation.
4+
#r @"../../src/FSharpPlus/bin/Release/netstandard2.0/FSharpPlus.dll"
5+
6+
(**
7+
ZipApplicative
8+
==============
9+
A functor with application, providing operations to embed pure expressions (``pur``), run computations pointwise and/or paralell and combine their results (``<.>``).
10+
___
11+
Minimal complete definition
12+
---------------------------
13+
* ``pur x`` &nbsp; . &nbsp; ``result x``
14+
* ``(<.>) f x``
15+
*)
16+
(**
17+
static member Pure (x: 'T) : 'ZipApplicative<'T>
18+
static member (<.>) (f: 'ZipApplicative<'T -> 'U>, x: 'ZipApplicative<'T>) : 'ZipApplicative<'U>
19+
*)
20+
(**
21+
22+
23+
Other operations
24+
----------------
25+
26+
* ``zip``
27+
*)
28+
(**
29+
static member Zip (x1: 'ZipApplicative<'T1>, x2: 'ZipApplicative<'T2>) : 'ZipApplicative<'T1 * 'T2>
30+
*)
31+
(**
32+
* ``map2``
33+
*)
34+
(**
35+
static member Map2 (f: 'T1 -> 'T2 -> 'T, x1: 'ZipApplicative<'T1>, x2: 'ZipApplicative<'T2>) : 'ZipApplicative<'T>
36+
*)
37+
38+
(**
39+
* ``map3``
40+
*)
41+
(**
42+
static member Map3 (f: 'T1 -> 'T2 -> 'T3 -> 'T, x1: 'ZipApplicative<'T1>, x2: 'ZipApplicative<'T2>, x3: 'ZipApplicative<'T3>) : 'ZipApplicative<'T>
43+
*)
44+
45+
(**
46+
47+
48+
Rules
49+
-----
50+
*)
51+
(**
52+
pur id <.> v = v
53+
pur (<<) <.> u <.> v <.> w = u <.> (v <.> w)
54+
pur f <*> pur x = pur (f x)
55+
u <*> pur y = pur ((|>) y) <.> u
56+
*)
57+
(**
58+
Related Abstractions
59+
--------------------
60+
- [Functor](abstraction-functor.html): A zipApplicative is a functor whose ``map`` operation can be splitted in ``pur`` and ``(<.>)`` operations,
61+
62+
- [ZipApplicative](abstraction-applicative.html) : ZipApplicatives are applicatives which usually don't form a [Monad](abstraction-monad.html).
63+
64+
Concrete implementations
65+
------------------------
66+
From F#
67+
68+
- ``seq<'T>``
69+
- ``list<'T>``
70+
- ``option<'T>`` *
71+
- ``voption<'T>`` *
72+
- ``Lazy<'T>`` *
73+
- ``Async<'T>``
74+
- ``Result<'T, 'U>``
75+
- ``Choice<'T, 'U>``
76+
- ``KeyValuePair<'Key, 'T>`` *
77+
- ``'Monoid * 'T`` *
78+
- ``ValueTuple<'Monoid, 'T>`` *
79+
- ``Task<'T>``
80+
- ``ValueTask<'T>``
81+
- ``'R -> 'T`` *
82+
- ``Expr<'T>`` *
83+
84+
85+
From F#+
86+
87+
- [``NonEmptySeq<'T>``]
88+
- [``NonEmptyList<'T>``](type-nonempty.html)
89+
- [``Compose<'ZipApplicative1<'ZipApplicative2<'T>>>``](type-compose.html)
90+
91+
(*) The operation is the same as that for the normal applicative
92+
93+
94+
Only for <*> operation:
95+
- ``array<'T>``
96+
- ``ResizeArray<'T>``
97+
- ``Map<'Key, 'T>``
98+
- ``Dictionary<'Key, 'T>``
99+
- ``IDictionary<'Key, 'T>``
100+
- ``IReadOnlyDictionary<'Key, 'T>``
101+
102+
103+
[Suggest another](https://github.com/fsprojects/FSharpPlus/issues/new) concrete implementation
104+
105+
Examples
106+
--------
107+
*)
108+
109+
110+
(**
111+
```f#
112+
#r @"nuget: FSharpPlus"
113+
```
114+
*)
115+
116+
open FSharpPlus
117+
118+
119+
// pointwise operations
120+
121+
let arr1 = (+) <!> [|1;2;3|] <*> [|10;20;30|]
122+
let arr2 = (+) <!> [|1;2;3|] <.> [|10;20;30|]
123+
124+
// val arr1: int array = [|11; 21; 31; 12; 22; 32; 13; 23; 33|]
125+
// val arr2: int array = [|11; 22; 33|]
126+
127+
128+
// Validations
129+
130+
let validated = app2 {
131+
let! x = async { return Ok 1 }
132+
and! y = async { return Ok 2 }
133+
and! z = async { return Error ["Error"] }
134+
return x + y + z
135+
}
136+
137+
validated |> Async.RunSynchronously
138+
// val it: Result<int,string list> = Error ["Error"]

docsrc/content/extensions.fsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,7 @@ The String type:
186186
* truncate, drop
187187
* findIndex, tryFindIndex
188188
* findSliceIndex, tryFindSliceIndex
189+
* findLastSliceIndex, tryFindLastSliceIndex
189190
* toArray, ofArray, toList, ofList, toSeq, ofSeq, toCodePoints, ofCodePoints
190191
* getBytes
191192
@@ -195,6 +196,7 @@ Collections / Traversable types:
195196
* intercalate, intersperse,
196197
* split, replace,
197198
* findSliceIndex, trySliceIndex,
199+
* findLastSliceIndex, tryLastSliceIndex,
198200
* partitionMap
199201
* [IList](reference/fsharpplus-ilist.html)
200202
* toIReadOnlyList
@@ -207,6 +209,7 @@ Collections / Traversable types:
207209
* split, replace,
208210
* toIReadOnlyList,
209211
* findSliceIndex, tryFindSliceIndex,
212+
* findLastSliceIndex, tryLastSliceIndex,
210213
* partitionMap
211214
* setAt, removeAt
212215
* [Enumerator](reference/fsharpplus-enumerator.html)
@@ -232,6 +235,7 @@ Collections / Traversable types:
232235
* replicate
233236
* toIReadOnlyList
234237
* findSliceIndex, tryFindSliceIndex
238+
* findLastSliceIndex, tryLastSliceIndex,
235239
* [ IReadOnlyCollection ](reference/fsharpplus-ireadonlycollection.html)
236240
* ofArray, ofList, ofSeq
237241
* map

0 commit comments

Comments
 (0)