F# Snippets

Recently added snippets

  • Async.TryFinally and an application

    F# computation expressions do not allow monadic expressions inside `finally` clauses. If we allow ourselves a bit of ugliness this can be circumvented by using a combinator. Here's an implementation for asynchronous workflows and a small application.

    Posted: yesterday by Eirik Tsarpalis

  • ImmutableDictionary module

    Functional programming operators related to the BCL ImmutableDictionary type.

    Posted: 3 days ago by Phillip Trelford

  • Cross Join Lists

    Given a list of lists, the function crossJoin outputs all combination of elements from the inner lists, i.e. each combination is a list which contains elements from each of the inner lists in the input. Note: Order is not preserved

    Posted: 8 days ago by Faisal Waris

Popular snippets

  • Adapter pattern

    Invoke the methods from incompatible types

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

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

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

  • 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

Snippets by tags

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

Snippets by authors

View all..

Database contains 1641 snippets out of which 1208 are public.