Skip to content

Instantly share code, notes, and snippets.

View panteamihai's full-sized avatar

Mihai Pantea panteamihai

  • Cluj-Napoca
View GitHub Profile
@panteamihai
panteamihai / LazyAndEager.cs
Created June 12, 2018 13:09
Lazy evaluation in action with generators, and eager evaluation with lists (from Intro to RX)
public static void HotIsEager_ColdIsLazy_InTheEnumerableObservableDuality()
{
void ReadFirstValue(IEnumerable<int> list)
{
foreach (var i in list)
{
Console.WriteLine("Read out first value of {0}", i);
break;
}
}