3 ms·
That shouldn't need a higher-kinded type though. With macros you can just write generic code that operates on futures or regular values.
by nnq 10y ago
That shouldn't need a higher-kinded type though. With macros you can just write generic code that operates on futures or regular values.
- lmm 10y agoCode that uses macros is no longer just code. You can't reason about them like normal code, nor use automated tools the way you usually would.
- virtualwhys 10y ago> that operates on futures or regular values. but what is the return type? The multisync example shows separate generated methods that return `string` and `Future[string]` depending on the method argument. If that's the case then blocking and non-blocking operations need to be treated separately since operations defined on a result of `Future[string]` are not the same as those available on `string`. HKTs not only allow for both method argument and return type to be polymorphic, but also allow one to define the same operations (like map, flatMap/bind, fold, etc.) on the wrapped type.