Recent snippets

Popular snippets

  • Implementing active objects with a MailboxProcessor

    Mailbox processors can easily be used to implement active objects. This example shows how to do that with a reusable wrapper type and minimal boilerplate code in the actual class definitions. Supports both asynchronous calls and synchronous calls. For the latter case, exceptions are automatically propagated back to the caller.

    90 people like this

    Posted: 10 years ago by Wolfgang Meyer

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

  • Split a list

    Three ways to split a list in half (but not necessarily in the middle). A forth version added that's very short and should be fast, as we only use List.fold. New champ found.

    78 people like this

    Posted: 10 years ago by Dmitri Pavlenkov

Snippets by tags

learning f# (16) http (17) sequence (32) parsing (26) agent (20) algorithms (25) generic programming (17) seq (54) html (15) design patterns (18) list (54) string (25) math (35) fold (21) wpf (20) lists (14) staging (18) lazy (20) tutorial (17) pattern matching (14)

View all...

Database contains 2634 snippets out of which 1655 is public.