Would it work If instead of a
suspend
keyword we have justSuspend ?=> A
It’s mean that function f: suspended A=>B. will have type. A => (Suspend? => B) ?
If yes, let we have List[A]
and method map[B](f: A=>B):List[B]
.
Than List.map(x => f(x)). will have type. List[Suspended?=>Int]. Is it what we want ?
val result = List(1,2,3).map(f)
if (result.head == 1) then
// never will be here ? or will ?