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.

    73 people like this

    Posted: 13 years ago by Dmitri Pavlenkov

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

    82 people like this

    Posted: 13 years ago by Tao Liu

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

    100 people like this

    Posted: 13 years ago by Neil Carrier

Snippets by tags

mailboxprocessor (27) parsing (28) reflection (19) collections (16) seq (54) regex (17) sequences (48) agent (20) tutorial (17) recursion (33) game (32) http (18) dsl (23) list (56) fold (22) f# (43) pattern matching (15) lazy (20) learning f# (16) wpf (20)

View all...

Database contains 3195 snippets out of which 1711 is public.