F# Snippets

Recently added snippets

Popular snippets

  • Pipeline list processing

    An example showing how to process list in a pipeline. We first use List.filter to return only even numbers and then use List.map to format them as strings.

    85 people like this
    Posted: 4 years ago by Tomas Petricek

  • Continuation-Passing Mnemonics

    Continuations provide a means whereby heap space can be traded for stack depth (heap space being generally more plentiful than stack depth). They are especially useful where tail recursion is not possible. Here are a couple of simple continuation examples that can be extended to cover more complex scenarios.

    88 people like this
    Posted: 4 years ago by Neil Carrier

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

    114 people like this
    Posted: 4 years ago by Alex Muscar

  • get the list of LAN Sql servers

    get the list of ethernet sql servers

    87 people like this
    Posted: 4 years ago by nCdy

  • Asynchronous sequences

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

    101 people like this
    Posted: 4 years ago by Tomas Petricek

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

    88 people like this
    Posted: 4 years ago by Wolfgang Meyer

Snippets by tags

string (16) array (13) game (29) Algorithms (24) SilverLight (21) Collections (16) sequences (44) web (19) Kata (16) tryfsharp (46) parsing (22) quotations (15) list (46) WPF (16) DSL (22) async (85) fold (16) f# (40) agent (19) Design Patterns (18) reflection (18) Seq (44) Learning F# (16) recursion (24) monad (20) tutorial (15) Sequence (28) MailboxProcessor (24) math (30) lazy (17)
View all..

Snippets by authors

View all..

Database contains 1746 snippets out of which 1283 are public.