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: 15 years ago by Tomas Petricek

  • Hello world (F#)

    Classical "Hello world" example that prints a message to the console output. This version uses F# printfn function to do the printing.

    186 people like this

    Posted: 15 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.

    85 people like this

    Posted: 15 years ago by Tomas Petricek

  • Split a list

    Three ways to split a list in half (but not necessarily in the middle). A forth version added that's very short and should be fast, as we only use List.fold. New champ found.

    84 people like this

    Posted: 14 years ago by Dmitri Pavlenkov

  • NUnit Sugar

    Some simple functions for writing more idiomatic F# tests with NUnit.

    91 people like this

    Posted: 15 years ago by Ryan Riley

  • Association list lookup

    While prototyping programs I find myself using association lists. This little snippet defines a lookup functions for association lists defined as lists of tuples.

    68 people like this

    Posted: 15 years ago by Alex Muscar

Snippets by tags

collections (16) silverlight (22) list (56) reflection (19) recursion (33) agent (20) array (22) dsl (23) parsing (28) tutorial (17) generic programming (17) kata (17) algorithms (25) game (32) fold (22) lazy (20) wpf (20) tryfsharp (48) learning f# (16) quotations (21)

View all...

Database contains 3208 snippets out of which 1719 is public.