Recent snippets

  • Functional wrappers for TryParse APIs

    Exemplary convenience wrappers for some of the System..TryParse APIs, using the combined power of F#' return value deconstruction mechanism via pattern matching, active patterns and option types instead of "out/ref" parameters. Added support for newest versions of F# to determine which overload of TryParse should be used.

    0 people like this

    Posted: 15 days ago by Cody

  • String.Join with pipe

    Just use the concat

    0 people like this

    Posted: 1 month ago by Tuomas Hietanen

  • Nested list functions

    Higher-order functions for working with nested lists that reimplement various useful List module functions, but work on nested lists, preserving the original nesting strucutre when possible.

    3 people like this

    Posted: 3 months ago by Tomas Petricek

Popular snippets

  • Chain of responsibility II

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

    104 people like this

    Posted: 13 years ago by Tao Liu

  • 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: 14 years ago by Neil Carrier

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

    86 people like this

    Posted: 14 years ago by Novox

Snippets by tags

tryfsharp (48) sequence (32) array (22) async (98) recursion (33) http (18) learning f# (16) sequences (48) wpf (20) staging (18) computation builder (17) tutorial (17) html (16) collections (16) seq (54) algorithms (26) generic programming (17) fold (22) game (32) computation expression (15)

View all...

Database contains 3198 snippets out of which 1713 is public.