Recent snippets

Popular snippets

  • 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

  • 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: 14 years ago by Alex Muscar

  • 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

math (35) html (16) http (18) generic programming (17) lists (15) kata (17) learning f# (16) monad (24) string (29) collections (16) array (22) web (29) sequences (48) f# (43) agent (20) staging (18) async (98) json (16) computation expression (15) list (56)

View all...

Database contains 3206 snippets out of which 1719 is public.