Skip to content

Repository files navigation

tinyield4net

Nuget

A Minimalistic, extensible and lazy sequence implementation for .Net .

Usage

An auxiliary Collapse() method, which merges series of adjacent elements is written with Tinyield in the following way:

Traverser<T>Collapse<T>(Query<T>src){return yld =>{Tprev=default(T);src.ForEach(item =>{if(prev.Equals(default(T))||!prev.Equals(item)){prev=item;yld(item);}});};}

This method can be chained in a sequence like this:

int[]arrange=newint[]{7,7,8,9,9,11,11,7};List<int>actual=Query.Of(arrange).Then(n =>Collapse(n)).Where(n =>n%2!=0).ToList();

Installation

$ dotnet add package com.tinyield.tinyield4net --version 1.0.0

Or check the nuget package for more info.

License

This project is licensed under Apache License, version 2.0

About

A Minimalistic, extensible and lazy sequence implementation for dotnet

Resources

Stars

0 stars

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages