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.

    75 people like this

    Posted: 16 years ago by Tomas Petricek

  • A beautiful fixed-point finding function

    We start with an initial value and then applying f repeatedly, until the value does not change anymore.

    303 people like this

    Posted: 15 years ago by Nick Palladinos

  • 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

Snippets by tags

tryfsharp (48) quotations (21) regex (17) kata (17) recursion (33) agent (20) computation expression (15) http (18) math (35) staging (18) sequence (32) fold (22) seq (54) pattern matching (15) mailboxprocessor (27) reflection (19) game (32) json (16) collections (16) algorithms (25)

View all...

Database contains 3212 snippets out of which 1719 is public.