glinq

command module
v0.0.0-...-7df7963 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 9, 2022 License: MIT Imports: 2 Imported by: 0

README

glinq

glinq (prounced "glink") is an attempt to provide a LINQ API using Go generics. The name uncreatively comes from combining Go and LINQ. Inspired by github.com/samber/lo

Long-term TODOs:

  • Implement parallel operations
  • Use fuzzing in testing
  • Full coverage of functions in LINQ
  • Complete testing with code coverage
  • Usage instructions and examples
  • Cancellation (esp. in channel operations)
  • Decide whether to implement container types (e.g. Set) like .NET has
  • Use t.Run(tc.name, ...) as the testing pattern rather than the janky string constructions currently in place.
  • Consider using literal instantiations instead of make everywhere
  • Organize file structure better

LINQ API scheme:

  • Aggregate
  • All
  • Any
  • Append
    • won't implement
  • AsEnumerable
    • won't implement
  • Average
  • Cast
    • won't implement
  • Chunk
  • Concat
    • won't implement
  • Contains
  • Count
  • DefaultIfEmpty
    • not worth implementing?
  • Distinct
  • DistinctBy
  • ElementAt
    • not worth implementing?
  • ElementAtOrDefault
    • not worth implementing?
  • Empty
    • not worth implementing?
  • Except
  • ExceptBy
  • First
  • FirstOrDefault
    • not worth implementing?
  • GroupBy
    • is this possible without anonymous types?
  • GroupJoin
  • Intersect
  • IntersectBy
  • Join
    • is this possible without anonymous types?
  • Last
  • LastOrDefault
    • not worth implementing?
  • LongCount
  • Max
  • MaxBy
  • Min
  • MinBy
  • OfType
    • is this possible with Go slices/channels?
  • OrderBy
  • OrderByDescending
  • Prepend
  • Range
  • Repeat
  • Reverse
  • Select
  • SelectMany
  • SequenceEqual
  • Single
  • SingleOrDefault
  • Skip
  • SkipLast
  • SkipWhile
  • Sum
  • Take
  • TakeLast
  • TakeWhile
  • ThenBy
  • ThenByDescending
  • ToArray
  • ToDictionary
  • ToHashSet
  • ToList
  • ToLookup
  • TryGetNonEnumeratedCount
  • Union
  • UnionBy
  • Where
  • Zip

Is there a way to add these methods onto generic slices/chans? Probably not, but if possible, should we?

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL