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
6 changes: 6 additions & 0 deletions global.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"sdk": {
"version": "10.0.103",
"rollForward": "minor"
}
}
4 changes: 4 additions & 0 deletions release-notes.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@

Release notes:

0.5.0
- update engineering to .NET 9/10

0.4.0
- overhaul all doc comments, add exceptions, improve IDE quick-info experience, #136, #220, #234
- new surface area functions, fixes #208:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<TreatWarningsAsErrors>True</TreatWarningsAsErrors>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<TreatWarningsAsErrors>True</TreatWarningsAsErrors>
</PropertyGroup>

Expand Down
4 changes: 2 additions & 2 deletions src/FSharp.Control.TaskSeq.Test/TaskSeq.Concat.Tests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -249,8 +249,8 @@ module SideEffect =
let mutable i = 0

taskSeq {
yield ResizeArray { 1..10 }
yield ResizeArray { 1..10 }
yield ResizeArray [ 1..10 ]
yield ResizeArray [ 1..10 ]

yield
ResizeArray(
Expand Down
22 changes: 3 additions & 19 deletions src/FSharp.Control.TaskSeq/TaskSeqInternal.fs
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,6 @@ module internal TaskSeqInternal =

let init count initializer = taskSeq {
let mutable i = 0
let mutable value: Lazy<'T> = Unchecked.defaultof<_>

let count =
match count with
Expand All @@ -290,28 +289,13 @@ module internal TaskSeqInternal =
match initializer with
| InitAction init ->
while i < count do
// using Lazy gives us locking and safe multiple access to the cached value, if
// multiple threads access the same item through the same enumerator (which is
// bad practice, but hey, who're we to judge).
if isNull value then
value <- Lazy<_>.Create(fun () -> init i)

yield value.Force()
value <- Unchecked.defaultof<_>
yield init i
i <- i + 1

| InitActionAsync asyncInit ->
while i < count do
// using Lazy gives us locking and safe multiple access to the cached value, if
// multiple threads access the same item through the same enumerator (which is
// bad practice, but hey, who're we to judge).
if isNull value then
// TODO: is there a 'Lazy' we can use with Task?
let! value' = asyncInit i
value <- Lazy<_>.CreateFromValue value'

yield value.Force()
value <- Unchecked.defaultof<_>
let! result = asyncInit i
yield result
i <- i + 1

}
Expand Down