Recent snippets

Popular snippets

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

    73 people like this

    Posted: 13 years ago by Tomas Petricek

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

    69 people like this

    Posted: 13 years ago by Rick Minerich

  • Haskell function : iterate

    Implements iterate function from Haskell's Prelude. The function generates an infinite sequence by applying a function to the initial value (first) and then to the result of previous application.

    203 people like this

    Posted: 13 years ago by Nick Palladinos

Snippets by tags

fold (22) monad (24) seq (54) computation expression (15) recursion (33) web (29) silverlight (22) algorithms (26) fparsec (15) lazy (20) kata (17) sequences (48) parsing (28) reflection (19) agent (20) tryfsharp (48) http (18) html (16) collections (16) regex (17)

View all...

Database contains 3195 snippets out of which 1711 is public.