pakoito
12/20/2017, 7:02 PMkevinherron
12/20/2017, 7:17 PMunsafeUnwrap()
on Try
nextkevinherron
12/20/2017, 7:18 PMpakoito
12/20/2017, 7:22 PMpakoito
12/20/2017, 7:22 PMkevinherron
12/20/2017, 7:26 PMkevinherron
12/20/2017, 7:26 PMgetOrElse
or fold
or my onSuccess
and onFailure
extensions (also want to PR those)pakoito
12/20/2017, 7:49 PMpakoito
12/20/2017, 7:49 PMpakoito
12/20/2017, 7:49 PMraulraja
12/20/2017, 8:06 PMSuccess(value)
. I've never had the need to use Try#get
or Option#get
. Also no need to use onSuccess or onFailure either those are just variants of fold where in the left you return Unit
and in the right you perform effects explicitly.raulraja
12/20/2017, 8:06 PMfold
kevinherron
12/20/2017, 8:06 PMkevinherron
12/20/2017, 8:07 PMonSuccess
reads much clearer than a fold
where you return Unit or whatever defaultkevinherron
12/20/2017, 8:08 PMItua
12/22/2017, 5:38 PMonSuccess
or you are returning the value if it’s successful when you call onSuccess
? If it’s the latter, the name `onSuccess`/`onFailure` can be miss-leading. The name is similar to the callback naming idioms.kevinherron
12/22/2017, 6:03 PMonSucccess((T) -> Unit)
and onFailure((Throwable) -> Unit)
kevinherron
12/22/2017, 6:04 PMItua
12/22/2017, 6:42 PMraulraja
12/24/2017, 2:14 PMunsafe
module or package. The distinction is that kategory and whatever it becomes is to be purely functional and other needs such as unsafe operators can be explicitly imported so that users are aware that is discouraged since those are a frequent source of bugs.kevinherron
12/26/2017, 5:01 PMraulraja
12/26/2017, 10:25 PMconst val DeprecatedUnsafeAccess: String = "This function is unsafe and will be removed in future versions of Arrow. Replace or import `arrow.syntax.unsafe.*` if you wish to continue using it in this way"
then in Try
@Deprecated(DeprecatedUnsafeAccess, ReplaceWith("getOrElse { ifEmpty }"))
abstract fun get(): A
as I port the funktionale data types over to arrow.