Recent snippets

  • Missile Command playable in tsunami.io

    Click on the tsunami.io button below to launch the online tsunami.io IDE with this snippet. Then select all the code (CTRL+A) and hit the Run button to start the game window, then just dock the window to the right of the code.. Click in the game window to launch missiles and save your cities.

    0 people like this

    Posted: 3 days ago by Phillip Trelford

  • Minimal Adaptive Cells (fable compatible)

    An implementation of minimal adaptive cells

    0 people like this

    Posted: 26 days ago by Onur Gumus

  • Functional wrappers for TryParse APIs

    Exemplary convenience wrappers for some of the System..TryParse APIs, using the combined power of F#' return value deconstruction mechanism via pattern matching, active patterns and option types instead of "out/ref" parameters. Added support for newest versions of F# to determine which overload of TryParse should be used.

    0 people like this

    Posted: 3 months ago by Cody

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

  • Dynamic operator using Reflection

    Demonstrates how to implement the dynamic operator (?) using .NET Reflection. The implementation supports calling constructors, propreties and methods using simple overload resolution (based on parameter count). It handles instance as well as static members.

    71 people like this

    Posted: 14 years ago by Tomas Petricek

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

    76 people like this

    Posted: 14 years ago by Tomas Petricek

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

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

    109 people like this

    Posted: 14 years ago by Antonio Cisternino

  • Haskell function : iterate

    Implements iterate function from Haskell's Prelude. The function generates an infinite sequence by applying a function to the initial value (first) and then to the result of previous application.

    203 people like this

    Posted: 14 years ago by Nick Palladinos

Snippets by tags

wpf (20) list (56) string (29) collections (16) sequences (48) staging (18) mailboxprocessor (27) f# (43) regex (17) monad (24) design patterns (18) recursion (33) json (15) lazy (20) async (98) http (18) fold (22) lists (15) dsl (23) quotations (21)

View all...

Database contains 3200 snippets out of which 1714 is public.