Recent snippets

Popular snippets

  • 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: 15 years ago by Nick Palladinos

  • Read only ref

    F# implementation of RO_ref from the "Effective ML" talk.

    93 people like this

    Posted: 15 years ago by fholm

  • 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

  • A beautiful fixed-point finding function

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

    303 people like this

    Posted: 15 years ago by Nick Palladinos

  • 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.

    75 people like this

    Posted: 15 years ago by Tomas Petricek

Snippets by tags

pattern matching (15) json (16) generic programming (17) sequence (32) fold (22) html (16) algorithms (25) wpf (20) design patterns (18) sequences (48) mailboxprocessor (27) silverlight (22) lazy (20) kata (17) lists (15) http (18) computation builder (17) parsing (28) tryfsharp (48) tutorial (17)

View all...

Database contains 3208 snippets out of which 1719 is public.