Recent snippets

Popular snippets

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

  • Struct Tuple

    Two/Three/Four-element generic tuples implemented as a value types for writing more efficient F# code.

    77 people like this

    Posted: 15 years ago by fholm

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

    75 people like this

    Posted: 15 years ago by Tomas Petricek

Snippets by tags

pattern matching (15) computation builder (17) string (29) fold (22) monad (24) recursion (33) generic programming (17) staging (18) kata (17) f# (43) game (32) quotations (21) math (35) sequences (48) sequence (32) http (18) reflection (19) tryfsharp (48) wpf (20) mailboxprocessor (27)

View all...

Database contains 3208 snippets out of which 1719 is public.