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: 23 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: 3 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: 7 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: 10 days ago by Daniel Fabian (@iceypoi)

  • Palindrom

    Check string of palindroms

    Posted: 12 days ago by Zhukoff Dima

  • Print a list in a spiral

    Prints a list in a spiral

    Posted: 13 days ago by devshorts

Popular snippets

  • 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

  • Read only ref

    F# implementation of RO_ref from the "Effective ML" talk.

    79 people like this
    Posted: 3 years ago by fholm

  • Chain of responsibility II

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

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

Snippets by tags

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

Snippets by authors

View all..

Database contains 1363 snippets out of which 1035 are public.