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: 14 years ago by Novox

  • Haskell function : iterate

    Implements iterate function from Haskell's Prelude. The function generates an infinite sequence by applying a function to the initial value (first) and then to the result of previous application.

    203 people like this

    Posted: 14 years ago by Nick Palladinos

Snippets by tags

fold (22) lazy (20) tutorial (17) recursion (33) array (22) mailboxprocessor (27) http (18) computation expression (15) list (56) reflection (19) web (29) string (29) pattern matching (15) collections (16) wpf (20) game (32) algorithms (26) regex (17) lists (15) kata (17)

View all...

Database contains 3206 snippets out of which 1719 is public.