Beispiel #1
0
 public RecursiveList <K> Map <K>(Func <T, K> func)
 {
     return(this switch
     {
         NilRecursiveList <T> _ => RecursiveList <K> .Nil,
         RecursiveList <T> _ => Tail.Map(func).Prepend(func(Head))
     });
 public bool MoveNext()
 {
     if (_recursiveList is NilRecursiveList <T> )
     {
         return(false);
     }
     else
     {
         _current       = _recursiveList.Head;
         _recursiveList = _recursiveList.Tail;
         return(true);
     }
 }
 public RecursiveListEnumerator(RecursiveList <T> recursiveList)
 {
     _recursiveList = recursiveList;
 }