Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@
"version": "11.4.3",
"commands": [
"fsdocs"
]
],
"rollForward": false
},
"fable": {
"version": "3.4.2",
"version": "4.25.0",
"commands": [
"fable"
]
],
"rollForward": false
}
}
}
11 changes: 5 additions & 6 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Setup .NET
uses: actions/setup-dotnet@v1
uses: actions/setup-dotnet@v4.3.1
with:
dotnet-version: '5.0.202'
dotnet-version: '8.0.x'
- name: Install tools
run: dotnet tool restore
- name: Build and Test
- name: Build and Test
run: dotnet test -c Release
- name: Pack
run: dotnet pack -c Release
- name: Build docs
- name: Build docs
run: dotnet fsdocs build --properties Configuration=Release
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
Expand All @@ -30,5 +30,4 @@ jobs:
run: dotnet nuget push src/FSharp.Control.AsyncSeq/bin/Release/*.nupkg -s https://api.nuget.org/v3/index.json -k ${{ secrets.NUGET_ORG_TOKEN_2021 }} --skip-duplicate

# NUGET_ORG_TOKEN_2021 is listed in "Repository secrets" in https://github.com/fsprojects/FSharp.Control.AsyncSeq/settings/secrets/actions
# note, the nuget org token expires around 24 July 2022

# note, the nuget org token expires around 24 July 2022
12 changes: 6 additions & 6 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup .NET
uses: actions/setup-dotnet@v1
- name: Setup .NET
uses: actions/setup-dotnet@v4.3.1
with:
dotnet-version: '5.0.202'
dotnet-version: '8.0.x'
- name: Setup Node.js environment
uses: actions/setup-node@v2.4.0
with:
node-version: 14.17.*
node-version: 14.17.*
- name: Install tools
run: dotnet tool restore
- name: Build and Test
- name: Build and Test
run: dotnet test -c Release
- name: Test Fable
run: cd tests/fable && npm i && npm test && cd ../..
run: (cd tests/fable && npm i && npm test)
25 changes: 25 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

38 changes: 38 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
description = "FSharp.Control.AsyncSeq";

# Flake inputs
inputs = {
nixpkgs.url = "https://flakehub.com/f/NixOS/nixpkgs/0.2405.*.tar.gz";
};

# Flake outputs
outputs = { self, nixpkgs }:
let
# Systems supported
allSystems = [
"x86_64-linux"
"aarch64-linux"
"x86_64-darwin"
"aarch64-darwin"
];

# Helper to provide system-specific attributes
forAllSystems = f: nixpkgs.lib.genAttrs allSystems (system: f {
pkgs = import nixpkgs { inherit system; };
});
in
{
# Development environment output
devShells = forAllSystems ({ pkgs }: {
default =

pkgs.mkShell {
packages = [
# pkgs.bashInteractive
pkgs.dotnetCorePackages.sdk_8_0
];
};
});
};
}
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "5.0.202",
"version": "8.0.19",
"rollForward": "minor"
}
}
13 changes: 6 additions & 7 deletions tests/FSharp.Control.AsyncSeq.Tests/AsyncSeqPerf.fsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#r @"../../bin/FSharp.Control.AsyncSeq.dll"
#r @"../../src/FSharp.Control.AsyncSeq/bin/Release/netstandard2.1/FSharp.Control.AsyncSeq.dll"
#nowarn "40"
#time "on"

Expand Down Expand Up @@ -107,7 +107,7 @@ let bindUnfold =



let collect n =
let collect n =
AsyncSeq.replicate n ()
|> AsyncSeq.collect (fun () -> AsyncSeq.singleton ())
|> AsyncSeq.iter ignore
Expand All @@ -122,7 +122,7 @@ let collect n =

let Y = Choice1Of2
let S = Choice2Of2

let timeMs = 500

let inp0 = [ ]
Expand All @@ -138,19 +138,18 @@ let toSeq (xs:Choice<int, int> list) = asyncSeq {
for x in xs do
match x with
| Choice1Of2 v -> yield v
| Choice2Of2 s -> do! Async.Sleep s }
| Choice2Of2 s -> do! Async.Sleep s }

for (inp,exp) in [ (inp0,exp0) ; (inp1,exp1) ] do

let actual =
let actual =
toSeq inp
|> AsyncSeq.bufferByTime (timeMs - 5)
|> AsyncSeq.map List.ofArray
|> AsyncSeq.toListSynchronously

printfn "actual=%A expected=%A" actual exp

//let ls = toSeq inp |> AsyncSeq.toListSynchronously
//let actualLs = actual |> List.concat


3 changes: 1 addition & 2 deletions tests/FSharp.Control.AsyncSeq.Tests/AsyncSeqTests.fs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#if INTERACTIVE
#load @"../../.paket/load/netcoreapp3.1/Test/NUnit.fsx"
#r "nuget: NUnit, 3.9.0"
#time "on"
#else

Expand All @@ -10,7 +10,6 @@ open NUnit.Framework
open FSharp.Control
open System
open System.Threading
open System.Threading.Tasks

type AsyncOps = AsyncOps with
static member unit : Async<unit> = async { return () }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<TargetFrameworks>net8.0</TargetFrameworks>
<IsPackable>false</IsPackable>
</PropertyGroup>
<ItemGroup>
Expand All @@ -13,4 +14,4 @@
<PackageReference Include="NUnit" Version="3.9.0" />
<PackageReference Include="NUnit3TestAdapter" Version="3.9.0" />
</ItemGroup>
</Project>
</Project>
Loading