This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//----------------------------------------------------------------------------// | |
extension KtScopeFunction<T> on T { | |
R let<R>(R Function(T it) block) => block(this); | |
T also(void Function(T it) block) { block(this); return this; } | |
T? takeIf(bool Function(T it) predicate) => predicate(this) ? this : null; | |
T? takeUnless(bool Function(T it) predicate) => predicate(this) ? null : this; | |
} |