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.

    69 people like this

    Posted: 13 years ago by Rick Minerich

  • Association list lookup

    While prototyping programs I find myself using association lists. This little snippet defines a lookup functions for association lists defined as lists of tuples.

    68 people like this

    Posted: 13 years ago by Alex Muscar

  • 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

kata (17) list (56) array (22) tutorial (17) generic programming (17) mailboxprocessor (27) recursion (33) computation builder (17) web (29) learning f# (16) html (15) silverlight (22) pattern matching (15) monad (23) agent (20) http (18) design patterns (18) tryfsharp (48) async (98) regex (17)

View all...

Database contains 3183 snippets out of which 1709 is public.