Recent snippets

Popular snippets

  • 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: 15 years ago by Alex Muscar

  • 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: 15 years ago by Neil Carrier

  • 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

Snippets by tags

reflection (19) quotations (21) sequence (32) regex (17) recursion (33) collections (16) computation builder (17) web (29) fold (22) kata (17) string (29) dsl (23) pattern matching (15) silverlight (22) staging (18) mailboxprocessor (27) http (18) sequences (48) lazy (20) computation expression (15)

View all...

Database contains 3208 snippets out of which 1719 is public.