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

  • 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

  • Hello world (F#)

    Classical "Hello world" example that prints a message to the console output. This version uses F# printfn function to do the printing.

    185 people like this

    Posted: 15 years ago by Tomas Petricek

Snippets by tags

sequence (32) list (56) fold (22) algorithms (26) collections (16) learning f# (16) web (29) regex (17) lists (15) array (22) silverlight (22) generic programming (17) f# (43) mailboxprocessor (27) monad (24) recursion (33) tutorial (17) agent (20) reflection (19) wpf (20)

View all...

Database contains 3207 snippets out of which 1719 is public.