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.

    107 people like this

    Posted: 13 years ago by Antonio Cisternino

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

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

    183 people like this

    Posted: 13 years ago by Tomas Petricek

  • Projecting lists

    Three functions showing how to implement projection for functional lists. First version uses naive recursion and the second one is tail-recursive using the accumulator parameter. The third version extends this with continuation passing.

    70 people like this

    Posted: 13 years ago by Tomas Petricek

  • Break sequence into n-element subsequences

    I'm working on parallel computations and I thought it would be useful to break work into chunks, especially when processing each element asynchronously is too expensive. The neat thing is that this function is general even though motivation for it is specific. Another neat thing is that this is true lazy sequence unlike what you'd get if you used Seq.groupBy. There are three versions for your enjoyment.

    72 people like this

    Posted: 13 years ago by Dmitri Pavlenkov

  • Chain of responsibility II

    Unlike the previous chain of responsibility, this version use the pipeline to chain responsibilities.

    103 people like this

    Posted: 12 years ago by Tao Liu

Snippets by tags

silverlight (22) agent (20) learning f# (16) html (15) array (22) list (56) fold (22) web (29) generic programming (17) regex (17) mailboxprocessor (27) string (27) pattern matching (15) wpf (20) json (15) algorithms (26) staging (18) fparsec (15) dsl (23) parsing (28)

View all...

Database contains 3183 snippets out of which 1709 is public.