Recent snippets

Popular snippets

  • A beautiful fixed-point finding function

    We start with an initial value and then applying f repeatedly, until the value does not change anymore.

    302 people like this

    Posted: 15 years ago by Nick Palladinos

  • 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

  • Projecting lists

    Three functions showing how to implement projection for functional lists. First version uses naive recursion and the second one is tail-recursive using the accumulator parameter. The third version extends this with continuation passing.

    74 people like this

    Posted: 15 years ago by Tomas Petricek

Snippets by tags

game (32) collections (16) mailboxprocessor (27) web (29) string (29) pattern matching (15) list (56) monad (24) wpf (20) design patterns (18) array (22) computation expression (15) lists (15) recursion (33) tutorial (17) tryfsharp (48) staging (18) json (16) kata (17) regex (17)

View all...

Database contains 3207 snippets out of which 1719 is public.