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.

    100 people like this

    Posted: 15 years ago by Neil Carrier

  • Split a list

    Three ways to split a list in half (but not necessarily in the middle). A forth version added that's very short and should be fast, as we only use List.fold. New champ found.

    84 people like this

    Posted: 15 years ago by Dmitri Pavlenkov

  • Wicked way to solve quadratic equation using list of operators

    This is to demonstrate that: (1) there are many ways to solve the same problems; (2) operators can be grouped together into data structures and act as data; (3) you can have fun in F# in many ways.

    57 people like this

    Posted: 15 years ago by Dmitry Soshnikov

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

    87 people like this

    Posted: 15 years ago by Novox

  • Read only ref

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

    93 people like this

    Posted: 15 years ago by fholm

  • Strategy pattern

    Strategy pattern in F#

    83 people like this

    Posted: 14 years ago by Tao Liu

Snippets by tags

mailboxprocessor (27) tryfsharp (48) sequences (48) lazy (20) quotations (21) silverlight (22) computation builder (17) design patterns (18) html (16) lists (15) learning f# (16) list (56) fold (22) collections (16) staging (18) kata (17) computation expression (15) monad (24) async (98) reflection (19)

View all...

Database contains 3208 snippets out of which 1719 is public.