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: 17 days ago by Cody

  • String.Join with pipe

    Just use the concat

    0 people like this

    Posted: 2 months 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

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

    185 people like this

    Posted: 14 years ago by Tomas Petricek

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

    83 people like this

    Posted: 13 years ago by Dmitri Pavlenkov

  • NUnit Sugar

    Some simple functions for writing more idiomatic F# tests with NUnit.

    90 people like this

    Posted: 14 years ago by Ryan Riley

  • Composable WCF Web API using Async

    A functional wrapper around the new WCF Web APIs (http://wcf.codeplex.com/). Composition is achieved through the use of the HttpRequestMessage -> Async signature. Pushing the app calls in the MessageHandler intercepts all requests and allows you to take control at the earliest point possible before operation selection occurs. Extending this slightly to call the innerChannel's SendAsync would allow you to create a middleware layer that would work both with this and other, normal Web API services.

    57 people like this

    Posted: 14 years ago by Ryan Riley

  • Factory Pattern

    Factory pattern in F#

    81 people like this

    Posted: 13 years ago by Tao Liu

  • 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

Snippets by tags

sequence (32) agent (20) game (32) tryfsharp (48) http (18) regex (17) learning f# (16) string (29) algorithms (26) staging (18) reflection (19) design patterns (18) generic programming (17) seq (54) silverlight (22) lazy (20) json (15) list (56) web (29) async (98)

View all...

Database contains 3198 snippets out of which 1713 is public.