F# Snippets

Recently added snippets

Popular snippets

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

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

  • Top-Down-Operator-Precedence Parser

    F# implementation of a generic Top-Down-Operator-Precedence Parser as described in this paper http://portal.acm.org/citation.cfm?id=512931 Example starts at line ~300

    80 people like this
    Posted: 4 years ago by fholm

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

    182 people like this
    Posted: 4 years ago by Nick Palladinos

  • 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

  • Hello world (F#)

    Classical "Hello world" example that prints a message to the console output. This version uses F# printfn function to do the printing.

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

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

Snippets by tags

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

Snippets by authors

View all..

Database contains 1577 snippets out of which 1169 are public.