Giter VIP home page Giter VIP logo

linqed's People

Contributors

ntwilson avatar

Watchers

 avatar  avatar

linqed's Issues

Zip overloads for up to 5 sequences.

How do we want to handle zipping multiple things together? TryApply is nice because it gives you the ability to zip as many things as you want together, but it's rather difficult to understand. It might be nice to make the 3/4 versions of Zip so that you don't have to understand Apply/TryApply for simple cases

TryOneOrMore .. TryFiveOrMore / TryExactlyOne .. TryExactlyFive

Perhaps doesn't belong in this library. This is helpful for code coverage because mixed with something like unless : (message:string) -> Option<'a> -> 'a you can assign a meaningful error message to a mismatching seq and get code coverage without having to write a test for every possible mismatch. (You just need tests for unless and for these few TryOneOrMore etc. functions

Fix XML comments without <summary>

You can sorta-kinda have XML comments where you leave off the <summary> tag, e.g.,

/// Adds 2 to an int
let add2 x = x + 2

but this can muck up your IDE. From C# (not sure if it's functions defined by C#, or consumed by C#), it just won't show the comment in the intellisense window at all. From F# (again, not sure if it's functions defined by or consumed by F#), it won't render any XML differently, so if you say:

/// Adds 2 to an <c>int</c> value
let add2 x = x + 2

it will display the literal "<c>int</c>" in the intellisense window.

We need to remove any instances of these shortened XML comments.

Split

Something like

let split isSplitElement xs = 
  let notSplitElement = not << isSplitElement
  let singleSplit input = (Seq.takeWhile notSplitElement input, Seq.skipWhile notSplitElement input)

  let rec split' state input = 
    match input with
    | Nil -> state
    | Cons (head, tail) ->
      let contiguous, restOfInput = singleSplit tail
      let nextChunk = cons head contiguous
      in split' (addToEnd state nextChunk) restOfInput

  let upToFirstSplit, remainder = singleSplit xs
  in cons upToFirstSplit (split' [] remainder)

Perhaps we want to use IEnumerators to improve performance.

Perhaps also SplitPairwise:

let splitPairwise splitBetween xs =
  match xs with
  | Nil -> Seq.empty
  | Cons (head, tail) ->
    let pairs =
      Seq.pairwise xs 
      |> split splitBetween 
    let rightHandOfPairs = Seq.map (Seq.map snd) pairs
    let firstChunk = cons head (Seq.head rightHandOfPairs)
    let restOfChunks = Seq.tail rightHandOfPairs
    in cons firstChunk restOfChunks

Factories for arrays and dictionaries

add a using static statement, and then:
Arr(1, 5, 7) instead of new[] { 1, 5, 7 }
Dict((1, "hi"), (2, "hello")) instead of new Dictionary<int, string> { { 1, "hi" }, { 2, "hello" } }

Manage System.ValueTuple version

by default it targets the latest version of System.ValueTuple. For codebases that target an older version of System.ValueTuple, referencing this project causes errors.

apply/applySafe

This was split off as a separate issue from #4. This covers the F# version, which is to create apply and applySafe

uncons

probably just for Seq and List, but not Array

EqualsWith

('a -> 'a -> bool) -> 'a seq -> 'a seq -> bool

Split

('a -> bool) -> 'a[] -> 'a[][]
Like String.Split, split at every occurrence of the predicate returning true.

Logo Proposal for Linqed

Hi, I'm a graphic designer and I like to collaborate with open source projects. Do you know that the graphic image of a project is very important? thinking about it I would like to design a logo for your Project Linqed.

I will be pleased to collaborate with you.

ExactlyTwoSafe/ExactlyThreeSafe, etc.?

This is mostly covered by the pattern matchers, but sometimes it's inconvenient to have to specify the full match if you are expecting an exact length, and should "crash" if that length isn't correct.

SkipUpTo

So it would just return an empty sequence if you skipped more elements than the original sequence contained (instead of throwing)

TryZip

This'll need to add a dependency for LanguageExt, since I intend on using their Option type. Just like normal LINQ Zip, but if the lengths are different, we return None.

Expand Readme

There already exists at least LinqPlus and LinqExt. Those libraries are very much different from this one. The readme should explain some of the philosophy behind this library and what to expect, and why one should use it.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.