Recent snippets

Popular snippets

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

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

    70 people like this

    Posted: 13 years ago by Tomas Petricek

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

    183 people like this

    Posted: 13 years ago by Tomas Petricek

Snippets by tags

design patterns (18) agent (20) reflection (19) fparsec (15) tutorial (17) game (32) regex (17) html (15) fold (22) http (18) dsl (23) math (35) web (29) kata (17) generic programming (17) f# (43) computation expression (15) collections (16) json (15) list (56)

View all...

Database contains 3183 snippets out of which 1709 is public.