ntwilson / linqed Goto Github PK
View Code? Open in Web Editor NEWLINQ Extended Design. Additional C# extension methods (inspired by LINQ) and F# collection functions
License: Creative Commons Zero v1.0 Universal
LINQ Extended Design. Additional C# extension methods (inspired by LINQ) and F# collection functions
License: Creative Commons Zero v1.0 Universal
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
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
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.
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
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" } }
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.
This was split off as a separate issue from #4. This covers the F# version, which is to create apply
and applySafe
probably just for Seq and List, but not Array
print out a string of the sequence F# %A style
('a -> 'a -> bool) -> 'a seq -> 'a seq -> bool
('a -> bool) -> 'a[] -> 'a[][]
Like String.Split
, split at every occurrence of the predicate returning true.
This too will require a dependency being added for LanguageExt.
to accompany .SequenceEqual
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.
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.
'a -> 'a seq -> 'a seq
So it would just return an empty sequence if you skipped more elements than the original sequence contained (instead of throwing)
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.
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.