Пример #1
0
 public static NonEmptyLazyList <A> Cons <A>(this A head, NonEmptyLazyList <A> nel)
 {
     return(new NonEmptyLazyList <A>(head, nel.PureMaybe));
 }
Пример #2
0
 public static Pair <A, IEnumerable <A> > HeadTail <A>(this NonEmptyLazyList <A> list)
 {
     return(Pair.Create(list.Head, list.Tail.Map(l => l.Enumerable()).ValueOr(Enumerable.Empty <A>)));
 }
Пример #3
0
 public Validation(NonEmptyLazyList <X> failures)
 {
     successValue  = default(A);
     failuresValue = failures;
     isSuccess     = false;
 }
Пример #4
0
 public Validation(A successValue)
 {
     this.successValue = successValue;
     failuresValue     = null;
     isSuccess         = true;
 }
Пример #5
0
 public NonEmptyLazyList <A> Op(NonEmptyLazyList <A> t1, NonEmptyLazyList <A> t2)
 {
     return(new NonEmptyLazyList <A>(
                t1.Head,
                () => Jib.Maybe.Just(t1.Tail.Cata(() => t2, nel => Op(nel, t2)))));
 }
Пример #6
0
 public static Validation <X, A> Failure <X, A>(NonEmptyLazyList <X> failures)
 {
     return(new Validation <X, A>(failures));
 }
Пример #7
0
 public static Validation <X, A> Failure <X, A>(X failureValue)
 {
     return(new Validation <X, A>(NonEmptyLazyList.Single(failureValue)));
 }