Recent snippets

Popular snippets

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

    74 people like this

    Posted: 15 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.

    73 people like this

    Posted: 15 years ago by Dmitri Pavlenkov

  • Creating objects with events

    This snippet shows how to create objects with events in F#. It shows both simple event (to be used from F#) and a .NET compatible event with specific delegate type.

    84 people like this

    Posted: 15 years ago by Tomas Petricek

Snippets by tags

learning f# (16) computation expression (15) lazy (20) recursion (33) fold (22) tryfsharp (48) collections (16) dsl (23) async (98) quotations (21) list (56) f# (43) lists (15) reflection (19) sequences (48) staging (18) json (16) html (16) seq (54) regex (17)

View all...

Database contains 3207 snippets out of which 1719 is public.