F# Snippets

Recently added snippets

  • Missionaries and Cannibals Problem and its state space tree

    Generating a state space tree to the Missionaries and Cannibals Problem (http://en.wikipedia.org/wiki/Missionaries_and_cannibals_problem). Then, this tree is iterated with depth-first approach, printing all the visitations. The solutions to problem have a depth equals 9.

    Posted: 8 hours ago by Fabio Galuppo

  • Infer Xml Schemas from Sample Documents

    XmlSchemas are used to validate XML documents. Following demonstrates how to infer a schema from sample documents. They are also used to visualize the structure of a class of documents.

    Posted: 2 days ago by Jonathan Leaver

  • Game of 2048

    Simple implementation of the popular game "2048". Can you add up the tiles and reach 2048? The game can be played in fsi or you can add the GUI which is so far missing.

    Posted: 6 days ago by Tore Green

  • Generic number literal

    A generic numeral G. It allows writing functions for arbitrary numeric type. The transformation is an efficient one, because it is implemented explicitly for every type. It combines the type classes technique of FsControl (https://github.com/gmpl/FsControl and http://www.nut-cracker.com.ar/index.php/typeclasses-for-fsharp) with numeric literals. But FsControl is removed to completely avoid unnecessary function calls.

    Posted: 9 days ago by Daniel Fabian (@iceypoi)

  • Palindrom

    Check string of palindroms

    Posted: 11 days ago by Zhukoff Dima

  • Print a list in a spiral

    Prints a list in a spiral

    Posted: 12 days ago by devshorts

Popular snippets

  • WPF / SilverLight Converter II

    version 1 is http://fssnip.net/62. This new version support convert from any existing function to a converter function by using composition and pipeline. The convert function is to make the function signature agree to the IValueConverter interface. You can add new functions in the FunctionLibrary module and reuse the class definition to reduce the coding effort. The first sample is to show how to make the converter pipeline work, the second one is a debugger converter used to debug the data binding problem.

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

  • Minimal XML DSL

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

    320 people like this
    Posted: 3 years ago by Blake Coverett

  • NUnit Sugar

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

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

Snippets by tags

WPF (15) agent (16) fold (11) Sequence (25) tryfsharp (37) string (14) async (63) SilverLight (21) F# (32) Design Patterns (18) math (28) Algorithms (21) reflection (18) MailboxProcessor (18) parsing (20) monad (18) sequences (42) Collections (12) web (15) recursion (22) seq (40) computation builder (13) tutorial (15) Learning F# (14) list (37) game (21) lists (12) lazy (16) Kata (15) DSL (20)
View all..

Snippets by authors

View all..

Database contains 1363 snippets out of which 1035 are public.