Skip to content

Instantly share code, notes, and snippets.

View profound7's full-sized avatar

Munir Hussin profound7

View GitHub Profile
@profound7
profound7 / AsyncFibonacci.hx
Created June 18, 2016 16:59
Transforming a function into a generator function
// original function
function fib():Iterator<Int> {
var a = 0;
var b = 1;
while (true) {
@yield a;
b = a + b;
@yield b;
a = a + b;