F# Snippets

Recently added snippets

  • 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: 2 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: 5 days ago by Daniel Fabian (@iceypoi)

  • Palindrom

    Check string of palindroms

    Posted: 7 days ago by Zhukoff Dima

Popular snippets

  • 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: 3 years ago by fholm

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

    93 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

Snippets by tags

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

Snippets by authors

View all..

Database contains 1359 snippets out of which 1033 are public.