Recent snippets

Popular snippets

  • Filtering lists

    Two functions showing how to filter functional lists using the specified predicate. First version uses naive recursion and the second one is tail-recursive using the accumulator parameter.

    77 people like this

    Posted: 15 years ago by Tomas Petricek

  • 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

  • Adapter pattern

    Invoke the methods from incompatible types

    111 people like this

    Posted: 15 years ago by Tao Liu

Snippets by tags

reflection (19) dsl (23) seq (54) quotations (21) regex (17) f# (43) kata (17) game (32) silverlight (22) generic programming (17) design patterns (18) lazy (20) string (29) sequence (32) monad (24) lists (15) json (16) recursion (33) async (98) web (29)

View all...

Database contains 3212 snippets out of which 1719 is public.