Recent snippets

Popular snippets

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

    71 people like this

    Posted: 8 years ago by Dmitri Pavlenkov

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

    65 people like this

    Posted: 8 years ago by Tomas Petricek

  • Strategy pattern

    Strategy pattern in F#

    72 people like this

    Posted: 7 years ago by Tao Liu

Snippets by tags

recursion (29) web (24) list (51) kata (17) learning f# (16) tryfsharp (48) random (12) lists (13) staging (18) http (15) regex (15) reflection (18) parsing (25) math (32) design patterns (18) string (22) lazy (19) collections (16) algorithms (25) fparsec (15)

View all...

Database contains 2297 snippets out of which 1564 is public.