Skip to content

Commit

Permalink
Remove derivedThrowableTailRecDsl
Browse files Browse the repository at this point in the history
  • Loading branch information
Atry committed Dec 27, 2021
1 parent 227a683 commit 2f9bb30
Showing 1 changed file with 0 additions and 36 deletions.
36 changes: 0 additions & 36 deletions Dsl/src/main/scala/com/thoughtworks/dsl/Dsl.scala
Original file line number Diff line number Diff line change
Expand Up @@ -375,42 +375,6 @@ object Dsl extends LowPriorityDsl0 {
): Dsl.Derived.StackUnsafe[Keyword, TailRec[Domain], Value] =
Dsl.Derived.StackUnsafe(derivedTailRecDsl)

private def derivedThrowableTailRecDsl[Keyword, LeftDomain, Value](implicit
restDsl: Dsl.Searching[Keyword, LeftDomain !! Throwable, Value]
): Dsl[Keyword, TailRec[LeftDomain] !! Throwable, Value] =
Dsl {
(
keyword: Keyword,
handler: (Value => TailRec[LeftDomain] !! Throwable)
) => (tailRecFailureHandler: Throwable => TailRec[LeftDomain]) =>
TailCalls.done(
restDsl(
keyword,
{ value => failureHandler =>
handler(value) { e =>
TailCalls.done(failureHandler(e))
}.result
}
) { e =>
tailRecFailureHandler(e).result
}
)
}
given [Keyword, LeftDomain, TailRecValue](using
Dsl.IsStackSafe[LeftDomain],
Dsl.Searching[Keyword, LeftDomain !! Throwable, TailRecValue]
): Dsl.Derived.StackSafe[Keyword, TailRec[
LeftDomain
] !! Throwable, TailRecValue] =
Dsl.Derived.StackSafe(derivedThrowableTailRecDsl)
given [Keyword, LeftDomain, TailRecValue](using
util.NotGiven[Dsl.IsStackSafe[LeftDomain]],
Dsl.Searching[Keyword, LeftDomain !! Throwable, TailRecValue]
): Dsl.Derived.StackUnsafe[Keyword, TailRec[
LeftDomain
] !! Throwable, TailRecValue] =
Dsl.Derived.StackUnsafe(derivedThrowableTailRecDsl)

private[dsl] type !![R, +A] = (A => R) => R

@FunctionalInterface
Expand Down

0 comments on commit 2f9bb30

Please sign in to comment.