Recent snippets

  • Get Bitcoin wallet


    0 people like this

    Posted: 14 days ago by The streets

  • Simple F# Expression to Java compiler

    Compiles simple F# quoted expressions (literals, values, operators, ifs and for loops) to Java code.

    1 people like this

    Posted: 1 month ago by Phillip Trelford

  • Distance sort

    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 this

    Posted: 1 month ago by Konstantin Sh

Popular snippets

  • Projecting lists

    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 this

    Posted: 12 years ago by Tomas Petricek

  • Struct Tuple

    Two/Three/Four-element generic tuples implemented as a value types for writing more efficient F# code.

    63 people like this

    Posted: 12 years ago by fholm

  • Partition a sequence until a predicate is satiated

    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 this

    Posted: 12 years ago by Rick Minerich

  • WPF / SilverLight Converter II

    version 1 is 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 this

    Posted: 11 years ago by Tao Liu

  • Dynamic operator using Reflection

    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 this

    Posted: 12 years ago by Tomas Petricek

  • The Haskell const function

    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 this

    Posted: 12 years ago by Alex Muscar

Snippets by tags

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)

View all...

Database contains 3139 snippets out of which 1704 is public.