Recent snippets

Popular snippets

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

    105 people like this

    Posted: 9 years ago by Antonio Cisternino

  • The Haskell const function

    The const function is simple, but you can use it to make your code more legible. In this example we convert a unary function to a function of arity 2 (that ignores the second argument). Also by using the flip function from Haskell (which is equally easy to define) you can ignore the first argument.

    119 people like this

    Posted: 9 years ago by Alex Muscar

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

    181 people like this

    Posted: 9 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).

    78 people like this

    Posted: 9 years ago by Tao Liu

  • A beautiful fixed-point finding function

    We start with an initial value and then applying f repeatedly, until the value does not change anymore.

    293 people like this

    Posted: 9 years ago by Nick Palladinos

  • WPF / SilverLight Converter II

    version 1 is http://fssnip.net/62. This new version support convert from any existing function to a converter function by using composition and pipeline. The convert function is to make the function signature agree to the IValueConverter interface. You can add new functions in the FunctionLibrary module and reuse the class definition to reduce the coding effort. The first sample is to show how to make the converter pipeline work, the second one is a debugger converter used to debug the data binding problem.

    86 people like this

    Posted: 9 years ago by Tao Liu

Snippets by tags

learning f# (16) tutorial (17) kata (17) pattern matching (14) fold (21) recursion (31) monad (22) dsl (23) web (27) array (22) string (24) http (16) game (31) sequences (47) html (15) tryfsharp (48) regex (15) generic programming (16) lazy (19) silverlight (22)

View all...

Database contains 2499 snippets out of which 1638 is public.