Recent snippets

Popular snippets

  • Exploring Population Data

    Learn Key Principle of F# in just a few minutes with the following Sample of "World Bank Type Provider - Exploring Population Data"

    383 people like this

    Posted: 11 years ago by Muhammad Mugees Asif

  • The Haskell const function

    The const function is simple, but you can use it to make your code more legible. In this example we convert a unary function to a function of arity 2 (that ignores the second argument). Also by using the flip function from Haskell (which is equally easy to define) you can ignore the first argument.

    119 people like this

    Posted: 15 years ago by Alex Muscar

  • Adapter pattern

    Invoke the methods from incompatible types

    110 people like this

    Posted: 14 years ago by Tao Liu

  • Factory Pattern

    Factory pattern in F#

    81 people like this

    Posted: 14 years ago by Tao Liu

  • 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

  • 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

Snippets by tags

reflection (19) tutorial (17) sequences (48) fold (22) computation expression (15) async (98) sequence (32) regex (17) list (56) seq (54) tryfsharp (48) monad (24) dsl (23) collections (16) quotations (21) wpf (20) kata (17) learning f# (16) mailboxprocessor (27) computation builder (17)

View all...

Database contains 3207 snippets out of which 1719 is public.