Recent snippets

Popular snippets

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

    88 people like this

    Posted: 6 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

    86 people like this

    Posted: 6 years ago by fholm

  • Composing a list of functions

    Composition of functions in F# is easily achieved by using the >> operator. You can also chain an arbitary amount of functions (represented as a list or sequence) together by folding the list/seq with >>. [More formally: the set of endomorphisms 'a -> 'a forms a monoid with the binary, associative operator ">>" (or "<<") and the neutral element "id".]

    77 people like this

    Posted: 6 years ago by Novox

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

    203 people like this

    Posted: 6 years ago by Nick Palladinos

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

    175 people like this

    Posted: 6 years ago by Tomas Petricek

  • Dynamic operator using Reflection

    Demonstrates how to implement the dynamic operator (?) using .NET Reflection. The implementation supports calling constructors, propreties and methods using simple overload resolution (based on parameter count). It handles instance as well as static members.

    61 people like this

    Posted: 6 years ago by Tomas Petricek

Snippets by tags

parsing (22) agent (20) design patterns (18) string (17) reflection (18) f# (42) fold (19) lists (13) http (14) collections (16) wpf (17) pattern matching (12) json (12) async (91) regex (12) sequences (47) math (32) algorithms (25) monad (20) sequence (29)

View all...

Database contains 2099 snippets out of which 1452 is public.