Recent snippets

Popular snippets

  • 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: 9 years ago by Alex Muscar

  • Read only ref

    F# implementation of RO_ref from the "Effective ML" talk.

    82 people like this

    Posted: 9 years ago by fholm

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

    78 people like this

    Posted: 9 years ago by Dmitri Pavlenkov

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

    89 people like this

    Posted: 9 years ago by Neil Carrier

  • Doughnut chart using chart controls

    The snippet shows how to use Microsoft Chart Controls (available in .NET 4.0 and for .NET 3.5) to draw a Doughnut chart. The sample shows proportion of seats taken by parties in UK elections.

    86 people like this

    Posted: 9 years ago by Tomas Petricek

  • Active pattern for let binding inside patterns

    The Let active pattern demonstrated by this snippet can be used to assign values to symbols in pattern matching. This is useful for writing complex pattern matching using match as we can handle multiple cases using a single clause.

    64 people like this

    Posted: 9 years ago by Tomas Petricek

Snippets by tags

generic programming (16) sequences (47) silverlight (22) pattern matching (14) regex (15) array (22) collections (16) staging (18) tryfsharp (48) parsing (26) seq (54) algorithms (25) tutorial (17) reflection (18) monad (22) fold (21) html (15) lazy (19) dsl (23) math (35)

View all...

Database contains 2481 snippets out of which 1637 is public.