CLOVIS
12/31/2022, 6:29 PMResult
type to avoid name clashes with the stdlib?Petr Laštovička
12/31/2022, 7:19 PMResultus
. It was kinda sus and didn't work out either 🐕Kristian Nedrevold
12/31/2022, 9:22 PMChris Lee
01/01/2023, 12:11 AMtry
.Chris Lee
01/01/2023, 12:21 AMSam Painter
01/01/2023, 3:32 PMCLOVIS
01/01/2023, 3:33 PMFailure
type that I want to use everywhere, so I want to
typealias ???<T> = Either<Failure, T>
CLOVIS
01/01/2023, 3:34 PMResult
is a great name, but since this alias will have the same generics signature as the one in the stdlib, it's too easy to mistake themSam Painter
01/01/2023, 3:41 PMCLOVIS
01/01/2023, 3:44 PMOutcome
is indeed pretty good 🤔CLOVIS
01/01/2023, 4:42 PMout
is not a keyword (unlike in
), and it's a pretty good builder name:
fun ping() = out {
Sam Painter
01/01/2023, 4:50 PMoutcomeOf
Sam Painter
01/01/2023, 4:51 PMout
not being a keyword though!CLOVIS
01/01/2023, 4:53 PMoutcomeOf()
takes a single value or a vararg (e.g. listOf(1)
, flowOf(1)
) and outcome {}
takes a lambda that actually does the computation (e.g. either {}
, flow {}
)Petr Laštovička
01/01/2023, 4:55 PMSam Painter
01/01/2023, 4:55 PMCLOVIS
01/01/2023, 4:55 PMCLOVIS
01/01/2023, 4:56 PMin
, imagine if we couldn't name a variable open
or data
😨