My current code is a bit broken right now. As deferred is not exactly delay, it can succeed or fail. So I probably need a union or something eventually. But let's assume there's no failure for now.
I would like to denote (TDeferred t/Num) to have a type m.d.Deferred (which is not parametrized) and at the same time calling deref on it should give me a t/Num. Am I wrong assuming the underlying type m.d.Deferred not having parametrized is not a problem here?
I am not exactly sure what you mean by fully expanded types. (TDeferred a) with some value of a is as expanded as I can think of. And a can be t/Any.
As to how it works runtime; (deferred/deferred) returns an m.d.Deferred. Then (deferred/success! a-deferred some-value) sets its value to be some-value and anything that's blocking on a-deferred (just like any other dereffable) would get this value. I was hoping parametrizing (deferred/deferred) as well as (deferred/success!) would do the trick. (Since I have a qualified (TDeferred t/Num) in function's annotation.)