76a9142220867b1e79c403fafe339a809a65ed01cb697988ac
0 people like thisPosted: 14 days ago by The streets
Compiles simple F# quoted expressions (literals, values, operators, ifs and for loops) to Java code.
1 people like thisPosted: 1 month ago by Phillip Trelford
Sort collection of items based on criteria of closest distance between consecutive items. The resulting collection first element is one of two farthest items, the end element is the second of the farthest pair. For the collection of `n` items the distance function is called n*(n-1) /2 times. The distance for pair of items is assumed to not depend on items order.
2 people like thisPosted: 1 month ago by Konstantin Sh
A variation of another snippet "Seq.groupWhen". This one groups adjacent elements based on a predicate that accepts two arguments - the previous and current elements
2 people like thisPosted: 2 months ago by Faisal Waris
Sample to estimate and visualize kernel densities of multiple distributions for visual comparison. Here the distributions of NY taxi fares are being compared by payment type (e.g. cash, credit card, etc.)
1 people like thisPosted: 2 months ago by Faisal Waris
Demonstrates how to use unfold to create an infinite list of the fibonacci numbers
1 people like thisPosted: 3 months ago by Dave Yost
Three functions showing how to implement projection for functional lists. First version uses naive recursion and the second one is tail-recursive using the accumulator parameter. The third version extends this with continuation passing.
68 people like thisPosted: 12 years ago by Tomas Petricek
Two/Three/Four-element generic tuples implemented as a value types for writing more efficient F# code.
63 people like thisPosted: 12 years ago by fholm
This function is given a partition predicate and a sequence. Until the predicate returns false, a list will be filled with elements. When it is, both the list and the remainder of the sequence will be returned. Note that this example preserves the laziness of the unchecked sequence elements.
68 people like thisPosted: 12 years ago by Rick Minerich
version 1 is http://fssnip.net/62. This new version support convert from any existing function to a converter function by using composition and pipeline. The convert function is to make the function signature agree to the IValueConverter interface. You can add new functions in the FunctionLibrary module and reuse the class definition to reduce the coding effort. The first sample is to show how to make the converter pipeline work, the second one is a debugger converter used to debug the data binding problem.
87 people like thisPosted: 11 years ago by Tao Liu
Demonstrates how to implement the dynamic operator (?) using .NET Reflection. The implementation supports calling constructors, propreties and methods using simple overload resolution (based on parameter count). It handles instance as well as static members.
71 people like thisPosted: 12 years ago by Tomas Petricek
The const function is simple, but you can use it to make your code more legible. In this example we convert a unary function to a function of arity 2 (that ignores the second argument). Also by using the flip function from Haskell (which is equally easy to define) you can ignore the first argument.
119 people like thisPosted: 12 years ago by Alex Muscar
agent (20) parsing (27) monad (23) lists (14) array (22) math (35) silverlight (22) json (14) reflection (19) mailboxprocessor (27) quotations (21) collections (16) pattern matching (15) recursion (33) wpf (20) sequences (48) http (18) f# (43) staging (18) fold (22)
Tao Liu (17) Antonio Cisternino (8) Tuomas Hietanen (74) Joel Huang (13) Rick Minerich (15) Brian Berns (9) Zhukoff Dima (8) Ryan Riley (25) Taha Hachana (12) Carsten König (10) Fabio Galuppo (14) Phillip Trelford (87) nagat01 (19) Vesa Karvonen (8) fholm (26) Samuel Bosch (12) Faisal Waris (37) David Klein (16) NIck Palladinos (14) Eirik Tsarpalis (89)
Database contains 3139 snippets out of which 1704 is public.