Recent snippets

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.

    63 people like this

    Posted: 6 years ago by Tomas Petricek

  • Chain of responsibility

    The following sample wants to make sure the person’s age is between 18 and 65, weight is no more than 200 and tall enough (>120).

    75 people like this

    Posted: 5 years ago by Tao Liu

  • Top-Down-Operator-Precedence Parser

    F# implementation of a generic Top-Down-Operator-Precedence Parser as described in this paper http://portal.acm.org/citation.cfm?id=512931 Example starts at line ~300

    86 people like this

    Posted: 5 years ago by fholm

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

    104 people like this

    Posted: 6 years ago by Tomas Petricek

  • Load XAML

    This example shows how to load a Xaml file allowing to use WPF from F#. It also shows how to access WPF objects and register event handlers.

    102 people like this

    Posted: 6 years ago by Antonio Cisternino

  • Continuation-Passing Mnemonics

    Continuations provide a means whereby heap space can be traded for stack depth (heap space being generally more plentiful than stack depth). They are especially useful where tail recursion is not possible. Here are a couple of simple continuation examples that can be extended to cover more complex scenarios.

    88 people like this

    Posted: 6 years ago by Neil Carrier

Snippets by tags

regex (12) kata (17) agent (20) async (91) list (48) recursion (26) parsing (22) collections (16) mailboxprocessor (25) dsl (22) html (14) silverlight (21) math (30) string (17) pattern matching (12) f# (42) fold (19) quotations (16) wpf (17) lists (13)

View all...

Database contains 2021 snippets out of which 1425 is public.