Recent snippets

Popular snippets

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

    77 people like this

    Posted: 14 years ago by Tomas Petricek

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

    100 people like this

    Posted: 14 years ago by Neil Carrier

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

    83 people like this

    Posted: 14 years ago by Tao Liu

Snippets by tags

agent (20) f# (43) sequences (48) reflection (19) array (22) design patterns (18) dsl (23) recursion (33) algorithms (26) tryfsharp (48) generic programming (17) computation expression (15) tutorial (17) game (32) silverlight (22) seq (54) regex (17) computation builder (17) collections (16) learning f# (16)

View all...

Database contains 3205 snippets out of which 1719 is public.