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: 15 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.

    75 people like this

    Posted: 15 years ago by Tomas Petricek

  • Factory Pattern

    Factory pattern in F#

    82 people like this

    Posted: 14 years ago by Tao Liu

Snippets by tags

learning f# (16) wpf (20) tutorial (17) pattern matching (15) reflection (19) collections (16) http (18) sequences (48) computation expression (15) html (16) web (29) math (35) sequence (32) monad (24) async (98) algorithms (25) agent (20) list (56) computation builder (17) string (29)

View all...

Database contains 3208 snippets out of which 1719 is public.