Skip to content

Commit 8129a7c

Browse files
committed
Revert "Fixed #86"
This reverts commit 9ee69d0.
1 parent 0dd9e3b commit 8129a7c

File tree

6 files changed

+2
-89
lines changed

6 files changed

+2
-89
lines changed

src/FsToolkit.ErrorHandling.JobResult/JobResultCE.fs

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -151,12 +151,4 @@ module JobResultCEExtensions =
151151
/// Method lets us transform data types into our internal representation.
152152
/// </summary>
153153
member inline _.Source(t : Task) : Job<Result<_,_>> = t |> Job.awaitUnitTask |> Job.map Ok
154-
155-
member inline __.Bind(asyncComputation: Async<_>, binder: 'T -> Job<Result<'U, 'TError>>) : Job<Result<'U, 'TError>> =
156-
__.Bind(asyncComputation |> Async.map Ok |> Job.fromAsync, binder)
157-
158-
member inline __.Bind(asyncComputation: Task<_>, binder: 'T -> Job<Result<'U, 'TError>>) : Job<Result<'U, 'TError>> =
159-
__.Bind(asyncComputation |> Task.map Ok |> Job.awaitTask, binder)
160-
161-
member inline __.Bind(asyncComputation: Job<_>, binder: 'T -> Job<Result<'U, 'TError>>) : Job<Result<'U, 'TError>> =
162-
__.Bind(asyncComputation |> Job.map Ok, binder)
154+

src/FsToolkit.ErrorHandling.TaskResult/TaskResultCE.fs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,6 @@ module TaskResultCE =
6868
| Error x -> ret <| Error x
6969
bindTaskConfigureFalse taskResult binder'
7070

71-
72-
73-
7471
member __.Delay
7572
(generator: unit -> Step<Result<'T, 'TError>>) =
7673
task.Delay(generator)
@@ -164,9 +161,3 @@ module TaskResultCEExtensions =
164161
/// Method lets us transform data types into our internal representation.
165162
/// </summary>
166163
member inline _.Source(t : Task) : Task<Result<_,_>> = task { return! t } |> Task.map Ok
167-
168-
member inline __.Bind(asyncComputation: Async<_>, binder: 'T -> Step<Result<'U, 'TError>>) : Step<Result<'U, 'TError>> =
169-
__.Bind(asyncComputation |> Async.map Ok |> Async.StartAsTask, binder)
170-
171-
member inline __.Bind(asyncComputation: Task<_>, binder: 'T -> Step<Result<'U, 'TError>>) : Step<Result<'U, 'TError>> =
172-
__.Bind(asyncComputation |> Task.map Ok, binder)

src/FsToolkit.ErrorHandling/AsyncResultCE.fs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -121,10 +121,6 @@ module AsyncResultCEExtensions =
121121
/// </summary>
122122
member inline __.Source(asyncComputation : Async<_>) : Async<Result<_,_>> = asyncComputation |> Async.map Ok
123123

124-
125-
member inline __.Bind(asyncComputation: Async<_>, binder: 'T -> Async<Result<'U, 'TError>>) : Async<Result<'U, 'TError>> =
126-
__.Bind(asyncComputation |> Async.map Ok, binder)
127-
128124
#if !FABLE_COMPILER
129125
/// <summary>
130126
/// Method lets us transform data types into our internal representation.
@@ -135,8 +131,4 @@ module AsyncResultCEExtensions =
135131
/// Method lets us transform data types into our internal representation.
136132
/// </summary>
137133
member inline _.Source(task : Task) : Async<Result<_,_>> =task |> Async.AwaitTask |> Async.map Ok
138-
139-
140-
member inline __.Bind(asyncComputation: Task<_>, binder: 'T -> Async<Result<'U, 'TError>>) : Async<Result<'U, 'TError>> =
141-
__.Bind(asyncComputation |> Async.AwaitTask |> Async.map Ok, binder)
142134
#endif

tests/FsToolkit.ErrorHandling.JobResult.Tests/JobResultCE.fs

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -146,32 +146,6 @@ let ``JobResultCE bind Tests`` =
146146

147147
Expect.equal actual (Result.Ok ()) "Should be ok"
148148
}
149-
testCaseJob "Let! outer Async wrapper" <| job {
150-
let innerData = "Foo"
151-
let! f = jobResult {
152-
let! (r : Result<_,_>) = AsyncResult.retn innerData
153-
Expect.equal r (Ok innerData) "Should be ok"
154-
}
155-
()
156-
}
157-
158-
testCaseJob "Let! outer Task wrapper" <| job {
159-
let innerData = "Foo"
160-
let! f = jobResult {
161-
let! (r : Result<_,_>) = Task.FromResult(Ok innerData)
162-
Expect.equal r (Ok innerData) "Should be ok"
163-
}
164-
()
165-
}
166-
167-
testCaseJob "Let! outer Job wrapper" <| job {
168-
let innerData = "Foo"
169-
let! f = jobResult {
170-
let! (r : Result<_,_>) = Job.result (Ok innerData)
171-
Expect.equal r (Ok innerData) "Should be ok"
172-
}
173-
()
174-
}
175149
]
176150

177151

tests/FsToolkit.ErrorHandling.TaskResult.Tests/TaskResultCE.fs

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -142,23 +142,6 @@ let ``TaskResultCE bind Tests`` =
142142

143143
Expect.equal actual (Result.Ok ()) "Should be ok"
144144
}
145-
testCaseTask "Let! outer Async wrapper" <| task {
146-
let innerData = "Foo"
147-
let! f = taskResult {
148-
let! (r : Result<_,_>) = AsyncResult.retn innerData
149-
Expect.equal r (Ok innerData) "Should be ok"
150-
}
151-
()
152-
}
153-
154-
testCaseTask "Let! outer Task wrapper" <| task {
155-
let innerData = "Foo"
156-
let! f = taskResult {
157-
let! (r : Result<_,_>) = Task.FromResult(Ok innerData)
158-
Expect.equal r (Ok innerData) "Should be ok"
159-
}
160-
()
161-
}
162145
]
163146

164147

tests/FsToolkit.ErrorHandling.Tests/AsyncResultCE.fs

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,8 @@ let ``AsyncResultCE bind Tests`` =
9090
return data
9191
}
9292
Expect.equal actual (data) "Should be ok"
93-
}
9493

94+
}
9595
testCaseAsync "Bind Ok Choice" <| async {
9696
let innerData = "Foo"
9797
let data = Choice1Of2 innerData
@@ -113,7 +113,6 @@ let ``AsyncResultCE bind Tests`` =
113113
Expect.equal actual (data) "Should be ok"
114114
}
115115

116-
117116
testCaseAsync "Bind Async" <| async {
118117
let innerData = "Foo"
119118
let d = Async.singleton innerData
@@ -125,15 +124,6 @@ let ``AsyncResultCE bind Tests`` =
125124
Expect.equal actual (Result.Ok innerData) "Should be ok"
126125
}
127126

128-
testCaseAsync "Let! outer Async wrapper" <| async {
129-
let innerData = "Foo"
130-
let! f = asyncResult {
131-
let! (r : Result<_,_>) = AsyncResult.retn innerData
132-
Expect.equal r (Ok innerData) "Should be ok"
133-
}
134-
()
135-
}
136-
137127

138128
#if !FABLE_COMPILER
139129
testCaseAsync "Bind Ok TaskResult" <| async {
@@ -163,15 +153,6 @@ let ``AsyncResultCE bind Tests`` =
163153

164154
Expect.equal actual (Result.Ok ()) "Should be ok"
165155
}
166-
167-
testCaseAsync "Let! outer Task wrapper" <| async {
168-
let innerData = "Foo"
169-
let! f = asyncResult {
170-
let! (r : Result<_,_>) = Task.FromResult(Ok innerData)
171-
Expect.equal r (Ok innerData) "Should be ok"
172-
}
173-
()
174-
}
175156
#endif
176157
]
177158

0 commit comments

Comments
 (0)