Recent snippets

  • Walkthrough: Creating an Asynchronous HTTP Handler

    The Microsoft tutorial Walkthrough: Creating an Asynchronous HTTP Handler did not describe how to use IHttpAsyncHandler from F#.
    It was also a bit complicated, because it did not show how to do it from Visual Studio. Here is the Visual Studio F# version. 1. Create empty ASP.NET Web Application. Call it FSharpHttpAsyncHandler. 2. Add a F# library project to the solution. Call it FSharpHttpAsyncHandler.Lib. 3. Add the following code to Library1.fs in FSharpHttpAsyncHandler.Lib 4. Add a reference to System.Web in FSharpHttpAsyncHandler.Lib 5. Add a reference to FSharpHttpAsyncHandler.Lib in FSharpHttpAsyncHandler. 6. Add the following to Web.config in FSharpHttpAsyncHandler. 7. In the Web tab of the project properties of FSharpHttpAsyncHandler, set Start url to http://localhost://whatever.SampleAsync 8. Run debug.

    2 people like this

    Posted: 9 days ago by Erling Hellenäs

  • FTPS download and upload a file

    FTPS = SSL encrypted FTP. SFTP = FTP over SSH.

    3 people like this

    Posted: 12 days ago by Tuomas Hietanen

  • ViewModelBase with strongly typed PropertyChanged subscription

    A base class for your view models with methods that take a code quotation of a property to subscribe to, and makes use of IObservable for strongly typed subscriptions to PropertyChanged for this property. You might want to use System.Reactive and insert `Observable.DistinctUntilChanged` after ``.

    2 people like this

    Posted: 20 days ago by Christer van der Meeren

  • SFTP with SSH.Net

    SFTP with SSH.Net

    2 people like this

    Posted: 27 days ago by Tuomas Hietanen

  • Azure Cosmos DB - Graph get started

    Translation of the Azure Cosmos DB Graph-get-started sample project ( A Cosmos DB account must first be created e.g. via the Azure Portal & from these the endpoint & authorization key are retrieved. Given these, the script creates: (i) Document Client (ii) Database (iii) Graph (aka Document Collection). From Gremlin expressions (strings) the command CreateGremlinQuery creates queries (IDocumentQueries) that can be executed to read from or modify the graph.

    2 people like this

    Posted: 1 month ago by roguetrainer

  • The Eff Monad via delimited continuations

    The Eff Monad via delimited continuations, based on

    1 people like this

    Posted: 1 month ago by NIck Palladinos

Popular snippets

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

  • 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: 7 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 Example starts at line ~300

    86 people like this

    Posted: 6 years ago by fholm

Snippets by tags

reflection (18) parsing (22) agent (20) pattern matching (12) dsl (22) f# (42) mailboxprocessor (25) fparsec (14) algorithms (25) recursion (26) web (23) math (32) quotations (17) sequence (29) array (18) tutorial (17) sequences (47) staging (18) kata (17) collections (16)

View all...

Database contains 2175 snippets out of which 1497 is public.