F# Snippets

Recently added snippets

  • Retry loop, no tricks

    Less-nonsense 8-line retry function that will retry a function a specified up to `maxRetries` times while it throws. After the retries, any remaining exception is allowed to propagate. Accepts a before function to allow you to wait/report when a retry is taking place

    Posted: 6 days ago by Ruben Bartelink

  • FoldBy Combinator

    Suggestion for a core library function.

    Posted: 12 days ago by Eirik Tsarpalis

  • Limit degree of parallelism using an agent

    The snippet implements a simple agent that limits the number of parallelism. When created, the agent takes the maximum number of tasks it can run in parallel. When it receives a "Start" message, it will then either run the task, or store it in a queue until earlier task ha completed.

    Posted: 12 days ago by Tomas Petricek

  • A Simple Parser

    This is a basic parser that I wrote which takes heavily from the examples in Dom Syme's Expert F# book and http://fsharpforfunandprofit.com/posts/pattern-matching-command-line/

    Posted: 17 days ago by Joe C

  • Just because

    It's probably not possible, but I'm going to see how far I can get...

    Posted: 29 days ago by mavnn

  • Using Azure Table Storage

    Using Azure Table Storage with WindowsAzure.Storage

    Posted: 1 months ago by Tuomas Hietanen

Popular snippets

  • Haskell function : iterate

    Implements iterate function from Haskell's Prelude. The function generates an infinite sequence by applying a function to the initial value (first) and then to the result of previous application.

    168 people like this
    Posted: 3 years ago by Nick Palladinos

  • NUnit Sugar

    Some simple functions for writing more idiomatic F# tests with NUnit.

    76 people like this
    Posted: 3 years ago by Ryan Riley

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

    81 people like this
    Posted: 3 years ago by Tomas Petricek

  • A beautiful fixed-point finding function

    We start with an initial value and then applying f repeatedly, until the value does not change anymore.

    251 people like this
    Posted: 3 years ago by Nick Palladinos

  • Exploring Population Data

    Learn Key Principle of F# in just a few minutes with the following Sample of "World Bank Type Provider - Exploring Population Data"

    367 people like this
    Posted: 8 months ago by Muhammad Mugees Asif

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

    78 people like this
    Posted: 3 years ago by Wolfgang Meyer

Snippets by tags

DSL (21) Sequence (28) computation builder (13) lazy (17) MailboxProcessor (20) Design Patterns (18) recursion (24) WPF (15) sequences (43) F# (33) web (15) Kata (16) Learning F# (15) string (14) tryfsharp (40) Algorithms (21) math (28) SilverLight (21) lists (12) Async (67) monad (18) fold (13) reflection (18) agent (17) collections (13) list (39) Seq (42) game (22) parsing (21) tutorial (15)
View all..

Snippets by authors

View all..

Database contains 1456 snippets out of which 1094 are public.