Recent snippets

Popular snippets

  • Chain of responsibility

    The following sample wants to make sure the person’s age is between 18 and 65, weight is no more than 200 and tall enough (>120).

    79 people like this

    Posted: 9 years ago by Tao Liu

  • 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: 10 years ago by Dmitri Pavlenkov

  • Continuation-Passing Mnemonics

    Continuations provide a means whereby heap space can be traded for stack depth (heap space being generally more plentiful than stack depth). They are especially useful where tail recursion is not possible. Here are a couple of simple continuation examples that can be extended to cover more complex scenarios.

    89 people like this

    Posted: 10 years ago by Neil Carrier

Snippets by tags

tryfsharp (48) game (32) seq (54) quotations (21) html (15) array (22) monad (22) kata (17) math (35) http (17) generic programming (17) learning f# (16) computation builder (14) pattern matching (14) tutorial (17) dsl (23) json (14) fparsec (15) fold (21) async (96)

View all...

Database contains 2677 snippets out of which 1659 is public.