F# Snippets

Recently added snippets

  • Fourth order Runge-Kutta ODE solver

    This is a simple and direct implementation of fourth order runge-kutta ordinary differential equation solver algorithm. In the main function three use cases are shown.

    Posted: 2 days ago by Antonio Prestes García

  • Musical Note Frequencies

    With the usual Western music it is common to use the Equal temperament: http://en.wikipedia.org/wiki/Equal_temperament http://hyperphysics.phy-astr.gsu.edu/hbase/music/et.html Then the note frequencies are calculated by this formula. For more information: http://en.wikipedia.org/wiki/Pitch_(music) http://en.wikipedia.org/wiki/Musical_tuning#Tuning_systems

    Posted: 3 days ago by Tuomas Hietanen

  • Generate a date range sequence (alternative)

    Generates a sequence of dates (ascending or descending), incrementing (or decrementing) by one day at a time, inclusive of the start and end dates. This is just simpler alternative version of: http://www.fssnip.net/oS (which was password-protected)

    Posted: 3 days ago by Tuomas Hietanen

Popular snippets

  • 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: 11 months ago by Muhammad Mugees Asif

  • Minimal XML DSL

    This snippet provides a very small internal DSL for creating and querying XML using the underlying XLinq classes.

    333 people like this
    Posted: 4 years ago by Blake Coverett

  • Adapter pattern

    Invoke the methods from incompatible types

    94 people like this
    Posted: 3 years ago by Tao Liu

  • FSX Structure

    I use this basic template when writing .fsx files that I might want to compile. It adjusts the difference in command line/entrypoint handling between a script and a compiled assembly. This example shows the details for a WPF script — replace the #r's and/or remove the STAThread for a WinForms or Console script.

    94 people like this
    Posted: 4 years ago by Blake Coverett

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

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

  • Load XAML

    This example shows how to load a Xaml file allowing to use WPF from F#. It also shows how to access WPF objects and register event handlers.

    94 people like this
    Posted: 4 years ago by Antonio Cisternino

Snippets by tags

MailboxProcessor (21) Algorithms (22) DSL (21) recursion (24) async (70) Sequence (28) sequences (43) game (22) math (29) agent (18) String (15) monad (18) tryfsharp (44) parsing (21) WPF (15) f# (33) computation builder (13) web (15) Kata (16) tutorial (15) lazy (17) Lists (13) Seq (44) list (41) fold (14) Learning F# (15) SilverLight (21) collections (13) reflection (18) Design Patterns (18)
View all..

Snippets by authors

View all..

Database contains 1511 snippets out of which 1130 are public.