diff --git a/global.json b/global.json new file mode 100644 index 00000000..badcd443 --- /dev/null +++ b/global.json @@ -0,0 +1,6 @@ +{ + "sdk": { + "version": "10.0.103", + "rollForward": "minor" + } +} diff --git a/release-notes.txt b/release-notes.txt index 7f0d630c..18ae26c7 100644 --- a/release-notes.txt +++ b/release-notes.txt @@ -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: diff --git a/src/FSharp.Control.TaskSeq.SmokeTests/FSharp.Control.TaskSeq.SmokeTests.fsproj b/src/FSharp.Control.TaskSeq.SmokeTests/FSharp.Control.TaskSeq.SmokeTests.fsproj index 83587f71..7b3f3e99 100644 --- a/src/FSharp.Control.TaskSeq.SmokeTests/FSharp.Control.TaskSeq.SmokeTests.fsproj +++ b/src/FSharp.Control.TaskSeq.SmokeTests/FSharp.Control.TaskSeq.SmokeTests.fsproj @@ -1,7 +1,7 @@ - net6.0 + net9.0 True diff --git a/src/FSharp.Control.TaskSeq.Test/FSharp.Control.TaskSeq.Test.fsproj b/src/FSharp.Control.TaskSeq.Test/FSharp.Control.TaskSeq.Test.fsproj index dbf1cfc5..dad6ebed 100644 --- a/src/FSharp.Control.TaskSeq.Test/FSharp.Control.TaskSeq.Test.fsproj +++ b/src/FSharp.Control.TaskSeq.Test/FSharp.Control.TaskSeq.Test.fsproj @@ -1,7 +1,7 @@ - net6.0 + net9.0 True diff --git a/src/FSharp.Control.TaskSeq.Test/TaskSeq.Concat.Tests.fs b/src/FSharp.Control.TaskSeq.Test/TaskSeq.Concat.Tests.fs index eefef383..5dd8e34b 100644 --- a/src/FSharp.Control.TaskSeq.Test/TaskSeq.Concat.Tests.fs +++ b/src/FSharp.Control.TaskSeq.Test/TaskSeq.Concat.Tests.fs @@ -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( diff --git a/src/FSharp.Control.TaskSeq/TaskSeqInternal.fs b/src/FSharp.Control.TaskSeq/TaskSeqInternal.fs index 66a92f2d..b9f94627 100644 --- a/src/FSharp.Control.TaskSeq/TaskSeqInternal.fs +++ b/src/FSharp.Control.TaskSeq/TaskSeqInternal.fs @@ -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 @@ -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 }