Joshua F
05/13/2018, 11:57 PMdiesieben07
05/14/2018, 11:25 AMnfrankel
05/14/2018, 11:26 AMdiesieben07
05/14/2018, 11:27 AMdiesieben07
05/14/2018, 11:29 AMdiesieben07
05/14/2018, 11:29 AMjackjill
05/14/2018, 1:26 PMMichael
05/14/2018, 4:22 PM/src/main/java/foo/bar/baz
path?, rather than forking it into .../java/...
and .../kotlin/...
?jw
05/14/2018, 4:23 PMrook
05/14/2018, 4:33 PMfabricio
05/14/2018, 4:36 PMkarelpeeters
05/14/2018, 4:36 PMlist.withIndex().flatMap { ... }
fabricio
05/14/2018, 4:36 PMfabricio
05/14/2018, 4:37 PMtschuchort
05/14/2018, 6:27 PM@Suppress("UNCHECKED_CAST")
fun <X, T : X, S : X> Observable<T>.then(other: Observable<S>): Observable<X>
= (this as Observable<X>).concatWith(other)
does this look like a terrible idea? It makes the type inference work betterkarelpeeters
05/14/2018, 6:30 PMtschuchort
05/14/2018, 6:30 PMkarelpeeters
05/14/2018, 6:30 PMObservable
is a class, right?karelpeeters
05/14/2018, 6:30 PMtschuchort
05/14/2018, 6:33 PMList
if you want to. Any monoidal structure will do. The point is that if you take a List<T>
and a List<S>
and combine them, the resulting list will have the type of their "closest" common super class List<X>
karelpeeters
05/14/2018, 6:35 PMkarelpeeters
05/14/2018, 6:35 PMMutableList
this would be a bad idea.tschuchort
05/14/2018, 6:36 PM(aList as List<X>).combine(bList)
. But you have to tell the compiler that aList
is also a List<X>
manually, which is quite annoyingaraqnid
05/14/2018, 10:35 PMfun <X> concat(vararg elements: Observer<X>): Observer<X>
(the Observer class I’m using defines X as having ‘out’ variance)
The compiler will choose an X so that all the observers passed as parameters are subtypeskarelpeeters
05/15/2018, 9:55 AMelect
05/15/2018, 10:03 AMelect
05/15/2018, 10:04 AMdavid-wg2
05/15/2018, 11:03 AM