Recently added snippets
This is a simple code implementation to copy Streams leveraging the Async workflow. After the first read, the write and read processes are done in parallel. I also used an Array of Array as buffer to avoid false sharing memory. An other improvment option could be to increase the buffer size if the copy is done in same machine.
Posted: yesterday by Riccardo Terrell
A type-level SAT solver in F#, inspired by https://gist.github.com/wouter-swierstra/0b6062c9660e751cd535
Posted: 2 days ago by Nick Palladinos
Continuing from https://twitter.com/JKPappas/status/558339587719045120, here's an approach on extending units of measure to arbitrary types.
Posted: 3 days ago by Eirik Tsarpalis
Functions to select the first element in an array that passes some predicate, and separately all the other array elements. (I'm not sure if this type of operation has a standard name. Please tweet me if you know!)
Posted: 3 days ago by Kit Eason
A function that will take a sequence of directory names and recursively find and return a sequence of all file names within.
Posted: 5 days ago by Andreas Ågren
You can create a 3D effect by taking each pixel from the source image (removing the red) and the pixel twenty places to its left (removing the blue and green) and blending the two together
Posted: 9 days ago by Riccardo Terrell
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.
99 people like this
Posted: 4 years ago by Alex Muscar
This snippet provides a very small internal DSL for creating and querying XML using the underlying XLinq classes.
333 people like this
Posted: 4 years ago by Blake Coverett
We start with an initial value and then applying f repeatedly, until the value does not change anymore.
261 people like this
Posted: 4 years ago by Nick Palladinos
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: 3 years ago by Tao Liu
This example shows how to load a Xaml file allowing to use WPF from F#. It also shows how to access WPF objects and register event handlers.
94 people like this
Posted: 4 years ago by Antonio Cisternino
Get Stock Quote Data and Historical Stock Prices from Yahoo Finance.
218 people like this
Posted: 4 years ago by Tuomas Hietanen
Snippets by tagsView all..
Snippets by authorsView all..
Database contains 1538 snippets out of which 1147 are public.