Recent snippets

Popular snippets

  • Partition a sequence until a predicate is satiated

    This function is given a partition predicate and a sequence. Until the predicate returns false, a list will be filled with elements. When it is, both the list and the remainder of the sequence will be returned. Note that this example preserves the laziness of the unchecked sequence elements.

    70 people like this

    Posted: 14 years ago by Rick Minerich

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

  • Chain of responsibility II

    Unlike the previous chain of responsibility, this version use the pipeline to chain responsibilities.

    104 people like this

    Posted: 14 years ago by Tao Liu

Snippets by tags

lists (15) quotations (21) sequence (32) web (29) seq (54) html (16) math (35) lazy (20) generic programming (17) recursion (33) async (98) pattern matching (15) tryfsharp (48) agent (20) collections (16) mailboxprocessor (27) monad (24) fold (22) regex (17) silverlight (22)

View all...

Database contains 3207 snippets out of which 1719 is public.