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

  • Composing a list of functions

    Composition of functions in F# is easily achieved by using the >> operator. You can also chain an arbitary amount of functions (represented as a list or sequence) together by folding the list/seq with >>. [More formally: the set of endomorphisms 'a -> 'a forms a monoid with the binary, associative operator ">>" (or "<<") and the neutral element "id".]

    87 people like this

    Posted: 15 years ago by Novox

  • Chain of responsibility

    The following sample wants to make sure the person’s age is between 18 and 65, weight is no more than 200 and tall enough (>120).

    85 people like this

    Posted: 14 years ago by Tao Liu

Snippets by tags

recursion (33) reflection (19) f# (43) wpf (20) sequence (32) html (16) lists (15) staging (18) regex (17) computation expression (15) tryfsharp (48) algorithms (26) collections (16) tutorial (17) parsing (28) lazy (20) list (56) agent (20) async (98) quotations (21)

View all...

Database contains 3208 snippets out of which 1719 is public.