phldavies
02/28/2025, 12:56 PMprivate fun <E, T> Raise<E>.contramap(f: (T) -> E): Raise<T> = object : Raise<T> {
override fun raise(e: T) = raise(f(e))
}
sane, assuming the mapped raise doesn't escape the bounds of the original raise?Youssef Shoaib [MOD]
02/28/2025, 2:32 PMwithError
is preferred, mostly because it can do it inline
phldavies
02/28/2025, 2:59 PMYoussef Shoaib [MOD]
02/28/2025, 3:01 PMrecover
would work naturally and replace the Raise), however as an implementation it's absolutely finephldavies
02/28/2025, 9:20 PMRaise
in a field in the scoped-raise type: https://github.com/arrow-kt/arrow/pull/3581/files#diff-a4074810ec25a2fa4d260ce79bf35b76759b9d55c4c7cf437e729766b31f8914R17-R19