F# Snippets

Recently added snippets

  • 99 Bottles of Beer on the Wall

    263 bytes (unix line endings ;))

    Posted: 7 days ago by Simon Dickson

  • Reading binary values from a file

    Small F# snippet on how to read 32-bit integers from a file at specific indexes.

    Posted: 10 days ago by Samuel Bosch

  • Binomial probabilities

    Simple function for commute binomial probabilities. For quick summary about binomial distribution: 1.) There are a fixed number of trials (n). 2.) Each trial has two possible outcomes: success of failure 3.) The probability of success (p) is the same for each trial. 4.) The trials are independent, meaning the outcome of one trial doesn't influence that of any other.

    Posted: 10 days ago by Martin Bodocky

Popular snippets

  • NUnit Sugar

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

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

  • Monadic Memoization

    Modular memoization within a pure functional setting that is implemented as a convenient computation builder.

    75 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"

    365 people like this
    Posted: 6 months ago by Muhammad Mugees Asif

  • Chain of responsibility II

    Unlike the previous chain of responsibility, this version use the pipeline to chain responsibilities.

    97 people like this
    Posted: 2 years ago by Tao Liu

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

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

  • A beautiful fixed-point finding function

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

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

Snippets by tags

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

Snippets by authors

View all..

Database contains 1426 snippets out of which 1075 are public.