Recent snippets

Popular snippets

  • 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

  • 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: 15 years ago by Novox

Snippets by tags

reflection (19) async (98) fold (22) algorithms (25) f# (43) regex (17) http (18) string (29) list (56) mailboxprocessor (27) tutorial (17) computation builder (17) kata (17) generic programming (17) web (29) staging (18) tryfsharp (48) monad (24) seq (54) computation expression (15)

View all...

Database contains 3208 snippets out of which 1719 is public.