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

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

    83 people like this

    Posted: 14 years ago by Dmitri Pavlenkov

  • 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

  • Read only ref

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

    92 people like this

    Posted: 14 years ago by fholm

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

    100 people like this

    Posted: 14 years ago by Neil Carrier

  • Composable WCF Web API using Async

    A functional wrapper around the new WCF Web APIs (http://wcf.codeplex.com/). Composition is achieved through the use of the HttpRequestMessage -> Async signature. Pushing the app calls in the MessageHandler intercepts all requests and allows you to take control at the earliest point possible before operation selection occurs. Extending this slightly to call the innerChannel's SendAsync would allow you to create a middleware layer that would work both with this and other, normal Web API services.

    57 people like this

    Posted: 14 years ago by Ryan Riley

  • Units of Measure

    Show's how to define units of measure to add stronger typing to your numerical functions.

    75 people like this

    Posted: 14 years ago by Robert Pickering

Snippets by tags

array (22) tryfsharp (48) mailboxprocessor (27) dsl (23) recursion (33) reflection (19) json (15) game (32) async (98) web (29) lists (15) string (29) kata (17) lazy (20) staging (18) f# (43) monad (24) silverlight (22) math (35) computation expression (15)

View all...

Database contains 3200 snippets out of which 1714 is public.