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: 9 days ago by Phillip Trelford

  • Minimal Adaptive Cells (fable compatible)

    An implementation of minimal adaptive cells

    0 people like this

    Posted: 1 month 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

  • 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

  • Struct Tuple

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

    76 people like this

    Posted: 14 years ago by fholm

  • 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

  • Composing a list of functions

    Composition of functions in F# is easily achieved by using the >> operator. You can also chain an arbitary amount of functions (represented as a list or sequence) together by folding the list/seq with >>. [More formally: the set of endomorphisms 'a -> 'a forms a monoid with the binary, associative operator ">>" (or "<<") and the neutral element "id".]

    86 people like this

    Posted: 14 years ago by Novox

  • Read only ref

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

    90 people like this

    Posted: 14 years ago by fholm

  • Exploring Population Data

    Learn Key Principle of F# in just a few minutes with the following Sample of "World Bank Type Provider - Exploring Population Data"

    383 people like this

    Posted: 11 years ago by Muhammad Mugees Asif

Snippets by tags

recursion (33) async (98) generic programming (17) algorithms (26) mailboxprocessor (27) quotations (21) learning f# (16) wpf (20) parsing (28) computation expression (15) http (18) computation builder (17) html (16) reflection (19) dsl (23) design patterns (18) sequence (32) kata (17) math (35) array (22)

View all...

Database contains 3200 snippets out of which 1714 is public.