Motoko Sharable Generics

The code works, yes. I can probably just use async instead of async*. Trying out a few things now.
That breaking will actually help me avoid specifying async all the way thru at the cost of adding a Timer when I need async. But if you ‘fix’ the breaking, my library will break :slight_smile:

I am making a demo use case, which will be ready soon.

For some unknown to me reason, Motoko required me to specify them once they became async. It could figure them out in the sync version.

For security, I think ‘allowing’ certain features when importing a library is better. Async isn’t the only thing that needs protecting and you can’t really add them all where async is.
func (x: Nat) : async,stablememory,cycles,certificates (Nat) { ... }
maybe this will be better
import Something "mo:something" stablememory, certificates, timers

I also wonder, is there a performance difference between these two (if nothing async happens, but we carry it around to provide the send capability:

let f = func () : async () { 
  let f = func () : async () { 
    let f = func () : async () {  }
    ignore f();
   }
  ignore f();
 }
ignore f();

and this:

let f = func () : () { 
  let f = func () : () { 
    let f = func () : () {  }
    f();
   }
  f();
 }
f();