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.

    74 people like this

    Posted: 15 years ago by Rick Minerich

  • Filtering lists

    Two functions showing how to filter functional lists using the specified predicate. First version uses naive recursion and the second one is tail-recursive using the accumulator parameter.

    77 people like this

    Posted: 15 years ago by Tomas Petricek

  • Chain of responsibility II

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

    106 people like this

    Posted: 15 years ago by Tao Liu

Snippets by tags

quotations (21) lazy (20) computation builder (17) computation expression (15) algorithms (25) monad (24) pattern matching (15) tryfsharp (48) web (29) tutorial (17) learning f# (16) html (16) regex (17) fold (22) seq (54) parsing (28) array (22) math (35) kata (17) collections (16)

View all...

Database contains 3209 snippets out of which 1719 is public.