{"id":19593680,"url":"https://github.com/vimaec/linqarray.dart","last_synced_at":"2026-05-10T23:46:50.350Z","repository":{"id":51560631,"uuid":"520498525","full_name":"vimaec/LinqArray.Dart","owner":"vimaec","description":"Dart implementation of LinqArray","archived":false,"fork":false,"pushed_at":"2022-08-02T13:20:34.000Z","size":14,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"develop","last_synced_at":"2025-01-09T07:09:15.053Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vimaec.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-08-02T12:56:12.000Z","updated_at":"2022-08-02T13:20:37.000Z","dependencies_parsed_at":"2022-08-22T06:40:52.622Z","dependency_job_id":null,"html_url":"https://github.com/vimaec/LinqArray.Dart","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vimaec%2FLinqArray.Dart","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vimaec%2FLinqArray.Dart/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vimaec%2FLinqArray.Dart/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vimaec%2FLinqArray.Dart/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vimaec","download_url":"https://codeload.github.com/vimaec/LinqArray.Dart/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240867432,"owners_count":19870405,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-11T08:40:42.642Z","updated_at":"2026-05-10T23:46:45.325Z","avatar_url":"https://github.com/vimaec.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"# LinqArray\n\n**LinqArray** is a pure functional .NET library from **[Ara 3D](https://ara3d.com)** that provides LINQ functionality for \nimmutable (read only) arrays, rather than streams, while preserving `O(1)` complexity when retrieving the count or items by index. \nIt is performant, memory efficient, cross-platform, safe, and easy to use.\n\n## Overview \n\nLinqArray is a set of extension methods build on the `System.IReadonlyList\u003cT\u003e` interface which effectively is: \n\n```\ninterface IReadonlyList\u003cT\u003e {\n    int Count { get; }\n    T this[int n] { get; }\n}\n```\n\nBecause the interface does not mutate objects it is safe to use in a multithreaded context. Furthermore, as with regular LINQ for `IEnumerable`, \nevaluation of many of the operations can be performed on demand (aka lazily). \n\n## Motivation\n\nThere are two key characteristics of an array data type which are important to maintain in some problem domains: \n1. Retrieving size of collection in `O(1)` \n2. Retrieving any item in collection by index in `O(1)` \n\nLINQ provides a large library of extremely useful and powerful algorithms that work on any data type that can be enumerated. \nHowever most LINQ methods return an `IEnumerable` interface which has `O(N)` time for retrieving the size of a collection, or `O(N)` time \nfor retrieving  an element in the collection at a given index. \n\n### Note about Big O Complexity \n\nThe notation `O(1)` is called Big-O notation and describes the average running time of an operation in terms of the size of the input set. \nThe `O(1)` means that the running time of the operation is a fixed constant independent of the size of the collection.  \n\n### Why use Interfaces versus Types \n\nUsing concrete types like `List` or `Array` versus an interface leadas to code that is more verbose and harder to maintain because it \ncommit library authors and consumers to uses a specific implementation of an abstract data type. Library functions then have to be written \nfor each type. This is why interfaces like `IEnumerable` are so prevalent: using extension methods we can easily write libraries that work \non any conforming type. The closest thing to an array \n\n## Extension Methods \n\nLinqArray provides many of the same extension methods for `IReadOnlyList` as LINQ does for objects implementing the `IEnumerable` interface. Some examples include: \n\n* `Aggregate`\n* `Select`\n* `Zip`\n* `Take`\n* `Skip` \n* `Reverse` \n* `All`\n* `Any`\n* `Count`\n\n## Status \n\nThe project is under heavy development but the core functionality is fixed. \n\n## Similar Work\n\nThis library is based on an article on CodeProject.com called [LINQ for Immutable Arrays](https://www.codeproject.com/Articles/517728/LINQ-for-Immutable-Arrays). While I worked at Autodesk we used a library based on this article in Autodesk 3ds Max 2016 and later, which shows that \n\nUnlike [LinqFaster](https://github.com/jackmott/LinqFaster) by Jack Mott evaluations of functions happen lazily, and have no side effects. This means that this library can be easily used in a multi-threaded context without inccurring the overhead and complexity of  synchronization. ","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvimaec%2Flinqarray.dart","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvimaec%2Flinqarray.dart","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvimaec%2Flinqarray.dart/lists"}