This PR makes AndThen internal, and uses it under andThen and compose to automatically try and make them stack-safe.
The rationale of deprecating AndThen to make it internal is that AndThen cannot guarantee stack-safety anyway. It makes the assumption that val f: (A) -> B is of depth 0.
If f is not of depth 0, it can still result in a stack-overflow.
andThen and compose are duplicated between arrow-syntax, and arrow-core but we might merge these two modules in the 0.13.0 release, at that point we can deprecate the andThen and compose in arrow.core in favor of arrow.syntax.* or the other way around.
This PR makes
AndThen
internal, and uses it underandThen
andcompose
to automatically try and make them stack-safe.The rationale of deprecating
AndThen
to make itinternal
is thatAndThen
cannot guarantee stack-safety anyway. It makes the assumption thatval f: (A) -> B
is of depth0
. Iff
is not of depth0
, it can still result in a stack-overflow.andThen
andcompose
are duplicated betweenarrow-syntax
, andarrow-core
but we might merge these two modules in the0.13.0
release, at that point we can deprecate theandThen
andcompose
inarrow.core
in favor ofarrow.syntax.*
or the other way around.