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: 2 months ago by Phillip Trelford

  • Minimal Adaptive Cells (fable compatible)

    An implementation of minimal adaptive cells

    0 people like this

    Posted: 3 months 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.

    1 people like this

    Posted: 5 months ago by Cody

Popular snippets

  • FSX Structure

    I use this basic template when writing .fsx files that I might want to compile. It adjusts the difference in command line/entrypoint handling between a script and a compiled assembly. This example shows the details for a WPF script — replace the #r's and/or remove the STAThread for a WinForms or Console script.

    124 people like this

    Posted: 14 years ago by Blake Coverett

  • 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

  • Minimal XML DSL

    This snippet provides a very small internal DSL for creating and querying XML using the underlying XLinq classes.

    374 people like this

    Posted: 14 years ago by Blake Coverett

  • Monadic Memoization

    Modular memoization within a pure functional setting that is implemented as a convenient computation builder.

    91 people like this

    Posted: 14 years ago by Nick Palladinos

  • Asynchronous sequences

    An asynchronous sequence is similar to the seq type, but the elements of the sequence are generated asynchronously without blocking the caller as in Async. This snippet declares asynchronous sequence and uses it to compare two files in 1k blocks.

    109 people like this

    Posted: 14 years ago by Tomas Petricek

  • ObservableObject

    The ObservableObject type implements the INotifyPropertyChanged interface used in WPF and Silverlight to notify on changes to properties that are bound to a control. Specify property names type safely using F# Quotations, i.e. <@ this.PropertyName @> when invoking the NotifyPropertyChanged method. If you are following the MVVM pattern then your View Model class can inherit from the ObservableObject type.

    67 people like this

    Posted: 14 years ago by Phillip Trelford

Snippets by tags

dsl (23) reflection (19) generic programming (17) json (15) computation builder (17) tutorial (17) game (32) mailboxprocessor (27) staging (18) agent (20) quotations (21) collections (16) async (98) lazy (20) seq (54) http (18) wpf (20) f# (43) algorithms (26) web (29)

View all...

Database contains 3200 snippets out of which 1714 is public.