Skip to content

Instantly share code, notes, and snippets.

@philipschwarz
Last active December 25, 2015 06:25
Show Gist options
  • Select an option

  • Save philipschwarz/e9b2401a84755de23b18 to your computer and use it in GitHub Desktop.

Select an option

Save philipschwarz/e9b2401a84755de23b18 to your computer and use it in GitHub Desktop.
import org.jooq.lambda.tuple.Tuple2;
import static java.util.stream.Stream.iterate;
import static org.jooq.lambda.tuple.Tuple.tuple;
public class Main
{
public static void main(String[] args)
{
iterate(
tuple(1,1),
t -> tuple(t.v2, t.v1 + t.v2)
).mapToInt(Tuple2::v1)
.limit(10).forEach(System.out::println);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment