Recently added snippets
F# lambda (quotation) to C# Expression<Func<_>> or Expression<Action<_>>
Posted: yesterday by Tuomas Hietanen
Some generic functions that use bit manipulation. They work for all signed integer types and are faster than the standard functions min, max, abs and sign.
Posted: 3 days ago by Sami Perttu
Calculate the Flesch Reading Ease Score for a string or a file. https://en.wikipedia.org/wiki/Flesch%E2%80%93Kincaid_readability_tests
Posted: 8 days ago by Kit Eason
Just download nssm at http://www.nssm.cc/download then install the HttpEcho.fsx script as a service: nssm.exe install HttpEcho 'C:\Program Files (x86)\Microsoft SDKs\F#\4.0\Framework\v4.0\FsiAnyCPU.exe' --exec c:/HttpEcho.fsx Now you're done. Off course you can install any fsx script as a service this way :D
Posted: 10 days ago by thinkbeforecoding
An agent is used to act as SMTP server and receive emails. Another agent receives emails from the SMTP server and also responds to requests for all emails received. A type is exposed that wraps this behaviour in a single method to get the list of emails.
Posted: 10 days ago by Nick Lydon
Quick script using FsLab that visualizes the aggregate number of downloads of a NuGet package over time, using the HTML type provider to get the data from www.nuget.org.
Posted: 11 days ago by Tomas Petricek
I use this basic template when writing .fsx files that I might want to compile. It adjusts the difference in command line/entrypoint handling between a script and a compiled assembly. This example shows the details for a WPF script — replace the #r's and/or remove the STAThread for a WinForms or Console script.
106 people like this
Posted: 4 years ago by Blake Coverett
Invoke the methods from incompatible types
95 people like this
Posted: 4 years ago by Tao Liu
version 1 is http://fssnip.net/62. This new version support convert from any existing function to a converter function by using composition and pipeline. The convert function is to make the function signature agree to the IValueConverter interface. You can add new functions in the FunctionLibrary module and reuse the class definition to reduce the coding effort. The first sample is to show how to make the converter pipeline work, the second one is a debugger converter used to debug the data binding problem.
83 people like this
Posted: 4 years ago by Tao Liu
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
82 people like this
Posted: 4 years ago by fholm
Mailbox processors can easily be used to implement active objects. This example shows how to do that with a reusable wrapper type and minimal boilerplate code in the actual class definitions. Supports both asynchronous calls and synchronous calls. For the latter case, exceptions are automatically propagated back to the caller.
89 people like this
Posted: 4 years ago by Wolfgang Meyer
The const function is simple, but you can use it to make your code more legible. In this example we convert a unary function to a function of arity 2 (that ignores the second argument). Also by using the flip function from Haskell (which is equally easy to define) you can ignore the first argument.
115 people like this
Posted: 4 years ago by Alex Muscar
Snippets by tagsView all..
Snippets by authorsView all..
Database contains 1787 snippets out of which 1309 are public.