Skip to content

sharpyr/Veho

Repository files navigation

Banner

Extend enumerable and array functionalities

Version Downloads Dependent Libraries Language Compatibility License

Features

Veho is an extension lib for iterable e.g. array, 2d-array and dictionary.

Content

Package Content
Veho The core library, including all Veho sub projects
Veho.Dictionary Extend IDictionary<TK, TV>
Veho.Entries Extend IReadOnlyList<(TK key, TV value)>
Veho.Enumerable Extend IEnumerable
Veho.Linear Perform basic linear algebra for matrix
Veho.Matrix Extend T[,]
Veho.Mutable.Matrix Extend IReadOnlyList<IReadOnlyList>
Veho.PanBase.Matrix Extend T[,]
Veho.Sequence Extend IReadOnlyList to List
Veho.Tuple Extend (T, T), (T, T, T), (T, T, T, T)
Veho.Types Base types in Veho series
Veho.Vector Extend T[]

Install

Veho targets .NET Standard 2.0, fits both .NET and .NET Framework.

Install Veho package and sub packages.

NuGet Package Manager:

Install-Package Veho

.NET CLI:

dotnet add package Veho

All versions can be found on nuget.

Usage

Zip two arrays into an new array

using Veho.Vector

var vecA = new[] {1, 2, 3, 4, 5};
var vecB = new[] {2, 2, 0, 3, 3};
Func<int, int, int> fn = (x, y) => x * y;
var vecC = fn.Zipper(vecA, vecB);
Console.WriteLine(string.Join(", ", vecC));

Compute max by reducing an array

using Veho.Vector;

var vec = Vec.From(1, 4, 6, 3, 2);
var max = vec.Reduce(Math.Max);
Console.WriteLine(max);

Push a value into an array

using Veho.Vector;
using Spare;

var arr = Vec.From("a", "b", "c");
arr.Push("d")
Console.WriteLine(arr.Deco())

Examples


Veho has a test suite in the test project.

Feedback

Veho is licensed under the MIT license.

Bug report and contribution are welcome at the GitHub repository.