Recent snippets

Popular snippets

  • Dynamic operator using Reflection

    Demonstrates how to implement the dynamic operator (?) using .NET Reflection. The implementation supports calling constructors, propreties and methods using simple overload resolution (based on parameter count). It handles instance as well as static members.

    74 people like this

    Posted: 14 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

  • Asynchronous sequences

    An asynchronous sequence is similar to the seq type, but the elements of the sequence are generated asynchronously without blocking the caller as in Async. This snippet declares asynchronous sequence and uses it to compare two files in 1k blocks.

    109 people like this

    Posted: 15 years ago by Tomas Petricek

Snippets by tags

sequence (32) lists (15) array (22) parsing (28) design patterns (18) web (29) quotations (21) mailboxprocessor (27) generic programming (17) silverlight (22) math (35) tryfsharp (48) pattern matching (15) staging (18) kata (17) json (16) async (98) string (29) computation builder (17) html (16)

View all...

Database contains 3208 snippets out of which 1719 is public.