Recent snippets

Popular snippets

  • 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

  • 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

  • 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

Snippets by tags

parsing (28) quotations (21) generic programming (17) kata (17) tryfsharp (48) recursion (33) pattern matching (15) computation expression (15) fold (22) seq (54) mailboxprocessor (27) design patterns (18) html (16) game (32) lists (15) web (29) regex (17) lazy (20) tutorial (17) reflection (19)

View all...

Database contains 3208 snippets out of which 1719 is public.