Exemplo n.º 1
0
 public static void Iterate <T>
     (this LazyList <T> list, Action <T> action)
 {
     if (list.IsEmpty)
     {
         return;
     }
     action(list.Head);
     list.Tail.Value.Iterate(action);
 }
Exemplo n.º 2
0
 public static LazyList <T> Append <T>
     (this LazyList <T> list, LazyList <T> items)
 {
     if (items.IsEmpty)
     {
         return(list);
     }
     return(new LazyList <T>(items.Head,
                             new Lazy <LazyList <T> >(() =>
                                                      list.Append(items.Tail.Value))));
 }