KS
Size: a a a
KS
Oℕ
w
D
D
KS
D
while ({
val ap = argF.asInstanceOf[Ap[F, Any, Any]]
argsF ::= ap.fp
argsFLength += 1
argF = ap.fn.asInstanceOf[FA[F, Any]]
argF.isInstanceOf[Ap[F, _, _]]
}) ()
// consecutive `ap` calls have been queued as operations;
// argF is no longer an `Ap` node, so the entire topmost left-associated
// function application branch has been looped through and we've
// moved (`argsFLength` - `lengthInitial`) arguments to the stack, through
// (`argsFLength` - `lengthInitial`) `Ap` nodes, so the function on the right
// which consumes them all must have (`argsFLength` - `lengthInitial`) arguments
val argc = argsFLength - lengthInitial
fns ::= Fn[G, Any, Any](foldArg(argF.asInstanceOf[FA[F, Any => Any]], f), argc)
fnsLength += 1
loop()
w
while ({
val ap = argF.asInstanceOf[Ap[F, Any, Any]]
argsF ::= ap.fp
argsFLength += 1
argF = ap.fn.asInstanceOf[FA[F, Any]]
argF.isInstanceOf[Ap[F, _, _]]
}) ()
// consecutive `ap` calls have been queued as operations;
// argF is no longer an `Ap` node, so the entire topmost left-associated
// function application branch has been looped through and we've
// moved (`argsFLength` - `lengthInitial`) arguments to the stack, through
// (`argsFLength` - `lengthInitial`) `Ap` nodes, so the function on the right
// which consumes them all must have (`argsFLength` - `lengthInitial`) arguments
val argc = argsFLength - lengthInitial
fns ::= Fn[G, Any, Any](foldArg(argF.asInstanceOf[FA[F, Any => Any]], f), argc)
fnsLength += 1
loop()
D
D
KS
D
KS
Oℕ
Oℕ
D
Oℕ