Recent snippets

Popular snippets

  • 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.

    63 people like this

    Posted: 8 years ago by Tomas Petricek

  • Pipeline list processing

    An example showing how to process list in a pipeline. We first use List.filter to return only even numbers and then use List.map to format them as strings.

    88 people like this

    Posted: 8 years ago by Tomas Petricek

  • Haskell function : iterate

    Implements iterate function from Haskell's Prelude. The function generates an infinite sequence by applying a function to the initial value (first) and then to the result of previous application.

    203 people like this

    Posted: 8 years ago by Nick Palladinos

  • Filtering lists

    Two functions showing how to filter functional lists using the specified predicate. First version uses naive recursion and the second one is tail-recursive using the accumulator parameter.

    65 people like this

    Posted: 8 years ago by Tomas Petricek

  • Creating objects with events

    This snippet shows how to create objects with events in F#. It shows both simple event (to be used from F#) and a .NET compatible event with specific delegate type.

    77 people like this

    Posted: 8 years ago by Tomas Petricek

  • Asynchronous sequences

    An asynchronous sequence is similar to the seq type, but the elements of the sequence are generated asynchronously without blocking the caller as in Async. This snippet declares asynchronous sequence and uses it to compare two files in 1k blocks.

    107 people like this

    Posted: 8 years ago by Tomas Petricek

Snippets by tags

lists (13) dsl (22) sequences (47) http (15) random (12) array (20) computation builder (14) monad (22) tryfsharp (48) parsing (25) html (15) mailboxprocessor (27) string (22) web (24) kata (17) agent (20) silverlight (22) fparsec (15) quotations (18) f# (42)

View all...

Database contains 2297 snippets out of which 1564 is public.