diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 1ce68bc5..fcdee700 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -3,7 +3,7 @@ "isRoot": true, "tools": { "fantomas": { - "version": "6.3.0-alpha-004", + "version": "7.0.5", "commands": [ "fantomas" ] diff --git a/AGENTS.md b/AGENTS.md index bea1ce81..f40a85b4 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -55,7 +55,7 @@ CI runs both debug and release test configurations on `windows-latest`. Test res ## Code Formatting -Formatting is enforced by **Fantomas** (version 6.3.0-alpha-004, configured as a dotnet local tool). +Formatting is enforced by **Fantomas** (version 7.0.5, configured as a dotnet local tool). Check formatting (CI runs this on every PR): diff --git a/src/FSharp.Control.TaskSeq.SmokeTests/TestUtils.fs b/src/FSharp.Control.TaskSeq.SmokeTests/TestUtils.fs index deb01c98..925fb53b 100644 --- a/src/FSharp.Control.TaskSeq.SmokeTests/TestUtils.fs +++ b/src/FSharp.Control.TaskSeq.SmokeTests/TestUtils.fs @@ -104,11 +104,7 @@ module Gen = /// properly, sequentially execute a chain of tasks in a non-blocking, non-overlapping way. let joinWithContinuation tasks = let simple (t: unit -> Task<_>) (source: unit -> Task<_>) : unit -> Task<_> = - fun () -> - source() - .ContinueWith((fun (_: Task) -> t ()), TaskContinuationOptions.OnlyOnRanToCompletion) - .Unwrap() - :?> Task<_> + fun () -> source().ContinueWith((fun (_: Task) -> t ()), TaskContinuationOptions.OnlyOnRanToCompletion).Unwrap() :?> Task<_> let rec combine acc (tasks: (unit -> Task<_>) list) = match tasks with diff --git a/src/FSharp.Control.TaskSeq.Test/TestUtils.fs b/src/FSharp.Control.TaskSeq.Test/TestUtils.fs index c9ffdca7..9f8407b6 100644 --- a/src/FSharp.Control.TaskSeq.Test/TestUtils.fs +++ b/src/FSharp.Control.TaskSeq.Test/TestUtils.fs @@ -263,11 +263,7 @@ module TestUtils = /// properly, sequentially execute a chain of tasks in a non-blocking, non-overlapping way. let joinWithContinuation tasks = let simple (t: unit -> Task<_>) (source: unit -> Task<_>) : unit -> Task<_> = - fun () -> - source() - .ContinueWith((fun (_: Task) -> t ()), TaskContinuationOptions.OnlyOnRanToCompletion) - .Unwrap() - :?> Task<_> + fun () -> source().ContinueWith((fun (_: Task) -> t ()), TaskContinuationOptions.OnlyOnRanToCompletion).Unwrap() :?> Task<_> let rec combine acc (tasks: (unit -> Task<_>) list) = match tasks with diff --git a/src/FSharp.Control.TaskSeq/TaskSeqBuilder.fs b/src/FSharp.Control.TaskSeq/TaskSeqBuilder.fs index 2268544a..46c0705f 100644 --- a/src/FSharp.Control.TaskSeq/TaskSeqBuilder.fs +++ b/src/FSharp.Control.TaskSeq/TaskSeqBuilder.fs @@ -544,10 +544,8 @@ module LowPriority = and ^Awaiter :> ICriticalNotifyCompletion and ^Awaiter: (member get_IsCompleted: unit -> bool) and ^Awaiter: (member GetResult: unit -> 'T)> - ( - task: ^TaskLike, - continuation: ('T -> ResumableTSC<'U>) - ) = + (task: ^TaskLike, continuation: ('T -> ResumableTSC<'U>)) + = ResumableTSC<'U>(fun sm -> let mutable awaiter = (^TaskLike: (member GetAwaiter: unit -> ^Awaiter) (task)) @@ -656,10 +654,7 @@ module HighPriority = member inline _.Bind(computation: Async<'T>, continuation: ('T -> ResumableTSC<'U>)) = ResumableTSC<'U>(fun sm -> - let mutable awaiter = - Async - .StartImmediateAsTask(computation, cancellationToken = sm.Data.cancellationToken) - .GetAwaiter() + let mutable awaiter = Async.StartImmediateAsTask(computation, cancellationToken = sm.Data.cancellationToken).GetAwaiter() let mutable __stack_fin = true diff --git a/src/FSharp.Control.TaskSeq/TaskSeqInternal.fs b/src/FSharp.Control.TaskSeq/TaskSeqInternal.fs index 578c6edc..cc279c13 100644 --- a/src/FSharp.Control.TaskSeq/TaskSeqInternal.fs +++ b/src/FSharp.Control.TaskSeq/TaskSeqInternal.fs @@ -1261,7 +1261,7 @@ module internal TaskSeqInternal = taskSeq { use e = source.GetAsyncEnumerator CancellationToken.None - for _ in count .. - 1 .. 1 do + for _ in count .. -1 .. 1 do let! step = e.MoveNextAsync() if not step then