Recent snippets

Popular snippets

  • Minimal XML DSL

    This snippet provides a very small internal DSL for creating and querying XML using the underlying XLinq classes.

    374 people like this

    Posted: 14 years ago by Blake Coverett

  • 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: 14 years ago by Tomas Petricek

  • Composing a list of functions

    Composition of functions in F# is easily achieved by using the >> operator. You can also chain an arbitary amount of functions (represented as a list or sequence) together by folding the list/seq with >>. [More formally: the set of endomorphisms 'a -> 'a forms a monoid with the binary, associative operator ">>" (or "<<") and the neutral element "id".]

    87 people like this

    Posted: 14 years ago by Novox

  • Monadic Memoization

    Modular memoization within a pure functional setting that is implemented as a convenient computation builder.

    91 people like this

    Posted: 14 years ago by Nick Palladinos

  • Adapter pattern

    Invoke the methods from incompatible types

    110 people like this

    Posted: 14 years ago by Tao Liu

  • 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

Snippets by tags

computation expression (15) algorithms (26) recursion (33) lazy (20) tutorial (17) sequences (48) wpf (20) design patterns (18) regex (17) kata (17) computation builder (17) sequence (32) agent (20) http (18) web (29) list (56) array (22) pattern matching (15) monad (24) string (29)

View all...

Database contains 3205 snippets out of which 1719 is public.