Recently added snippets
There are some nuances to using the regular expression type provider that are easy to miss. This snippet addresses them.
Posted: 3 days ago by musicologyman
Needed to partition a list into multiple groups, but couldn't find an existing way to do it. Have not put this as an extension method as needed it in an .fsx file which is loaded, but couldn't get extension method to work from that.
Posted: 4 days ago by @BrockSamsonUK
263 bytes (unix line endings ;))
Posted: 4 days ago by Simon Dickson
Small F# snippet on how to read 32-bit integers from a file at specific indexes.
Posted: 7 days ago by Samuel Bosch
Simple function for commute binomial probabilities. For quick summary about binomial distribution: 1.) There are a fixed number of trials (n). 2.) Each trial has two possible outcomes: success of failure 3.) The probability of success (p) is the same for each trial. 4.) The trials are independent, meaning the outcome of one trial doesn't influence that of any other.
Posted: 7 days ago by Martin Bodocky
Split a list into chunks using the specified separator. This takes a list and returns a list of lists (chunks) that represent individual groups, separated by the given separator 'v'
Posted: 15 days ago by Tomas Petricek
Unlike the previous chain of responsibility, this version use the pipeline to chain responsibilities.
97 people like this
Posted: 2 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: 2 years ago by Tao Liu
Some simple functions for writing more idiomatic F# tests with NUnit.
76 people like this
Posted: 3 years ago by Ryan Riley
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
80 people like this
Posted: 3 years ago by fholm
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.
81 people like this
Posted: 3 years ago by Neil Carrier
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.
77 people like this
Posted: 3 years ago by Wolfgang Meyer
Snippets by tagsView all..
Snippets by authorsView all..
Database contains 1423 snippets out of which 1074 are public.