public static NonEmptyLazyList <A> Cons <A>(this A head, NonEmptyLazyList <A> nel) { return(new NonEmptyLazyList <A>(head, nel.PureMaybe)); }
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>))); }
public Validation(NonEmptyLazyList <X> failures) { successValue = default(A); failuresValue = failures; isSuccess = false; }
public Validation(A successValue) { this.successValue = successValue; failuresValue = null; isSuccess = true; }
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))))); }
public static Validation <X, A> Failure <X, A>(NonEmptyLazyList <X> failures) { return(new Validation <X, A>(failures)); }
public static Validation <X, A> Failure <X, A>(X failureValue) { return(new Validation <X, A>(NonEmptyLazyList.Single(failureValue))); }