Snippets created by Dmitri Pavlenkov
Break sequence into n-element subsequences
I'm working on parallel computations and I thought it would be useful to break work into chunks, especially when processing each element asynchronously is too expensive. The neat thing is that this function is general even though motivation for it is specific. Another neat thing is that this is true lazy sequence unlike what you'd get if you used Seq.groupBy. There are three versions for your enjoyment.
38 people like this
Posted: 1 years ago by Dmitri PavlenkovFibonacci sequence
Cached fib sequence
10 people like this
Posted: 1 years ago by Dmitri Pavlenkovinline pow
LanguagePrimitives help create inline functions
23 people like this
Posted: 1 years ago by Dmitri Pavlenkov
Inline factorial samples with fix point
While reading Tomas Petricek's master thesis, came across FIX operator implementation. Decided to experiment with various implementations of factorial.
10 people like this
Posted: 1 years ago by Dmitri PavlenkovRe-creating arithmetic with DU
You never know when you might need this.
7 people like this
Posted: 1 years ago by Dmitri PavlenkovSplit a list
Three ways to split a list in half (but not necessarily in the middle). A forth version added that's very short and should be fast, as we only use List.fold. New champ found.
48 people like this
Posted: 1 years ago by Dmitri Pavlenkov