``` class Async_load<WaitT, ErrorT, DoneT> (...
# announcements
i
Copy code
class Async_load<WaitT, ErrorT, DoneT> (
        val w: WaitT,
        f: Async_load<WaitT, ErrorT, DoneT>.(WaitT) -> Unit) {

    var state = Async_load_state.Wait<WaitT, ErrorT, DoneT>(w)
    init { f(w) }

    fun is_done(): Boolean {
        return when(state) {
            is Async_load_state.Error<*, *, *> -> true
            is Async_load_state.Done<*, *, *> -> true
            else -> false
        }
    }
}
Is there a way to simplify this? I do not want to repeat <WaitT, ErrorT, DoneT> all the time
g
You can use typealias
i
Can you typealias a Triplet?
g
Yes ,but not only generics, whole type
Copy code
typealias AsyncWait = Async_load_state.Wait<WaitT, ErrorT, DoneT>
Depends on use case of course, you can have typealias for type or type + required generics