Recent snippets

Popular snippets

  • Partition a sequence until a predicate is satiated

    This function is given a partition predicate and a sequence. Until the predicate returns false, a list will be filled with elements. When it is, both the list and the remainder of the sequence will be returned. Note that this example preserves the laziness of the unchecked sequence elements.

    74 people like this

    Posted: 15 years ago by Rick Minerich

  • Struct Tuple

    Two/Three/Four-element generic tuples implemented as a value types for writing more efficient F# code.

    77 people like this

    Posted: 15 years ago by fholm

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

    92 people like this

    Posted: 15 years ago by Wolfgang Meyer

Snippets by tags

design patterns (18) quotations (21) list (56) parsing (28) dsl (23) web (29) sequence (32) staging (18) http (18) regex (17) wpf (20) computation builder (17) generic programming (17) json (16) collections (16) recursion (33) monad (24) tryfsharp (48) game (32) fold (22)

View all...

Database contains 3212 snippets out of which 1719 is public.