F# Snippets
Recently added snippets
WPF Command in F#
demonstrate how to use object expression to create a WPF/Silverlight command.
Posted: 8 hours ago by Tao Liu
csproj-file parsing with Linq2Xml - part 2
This program reads all *.csproj-files from a path and then uses Linq2Xml to show or modify data about the projects. This should be a good template for scripts to manage tons of c#-project files. F# and LINQ-to-XML is very powerful combination.
Posted: 12 hours ago by Tuomas Hietanen
Take a sample of a sequence
Take a sample of a specified length from a sequence. The sample is guaranteed to be of the requested size (unless there are too few elements in the original sequence). Sample items will be taken at equal intervals, with possibly a shorter interval at the end if the sequence length is not evenly divisible by the sample size.
Posted: 2 days ago by Kit Eason
Transform a sequence into a sequence-of-sequences
Take a sequence and make it into a sequence of sequences, where the inner sequences are of a specified length. (The last inner sequence may be shorter.) Useful, for instance, for rending sequences into two-way HTML grids.
Posted: 2 days ago by Kit Eason
Dining philosophers (Joinads)
A simple and declarative solution based on Joinads.
Posted: 3 days ago by Nick Palladinos
Factoring out FSharpChart
Using FSharpChart control. Just call Charting.Plot() to chart series or collections of series. No need to create forms, etc.
Posted: 4 days ago by Boris Kogan
Popular snippets
Monadic Memoization
Modular memoization within a pure functional setting that is implemented as a convenient computation builder.
54 people like this
Posted: 11 months ago by Nick PalladinosGet Stock Quote Data and Historical Stock Prices from Yahoo Finance
Get Stock Quote Data and Historical Stock Prices from Yahoo Finance.
117 people like this
Posted: 1 years ago by Tuomas HietanenHaskell function : iterate
Implements iterate function from Haskell's Prelude. The function generates an infinite sequence by applying a function to the initial value (first) and then to the result of previous application.
89 people like this
Posted: 1 years ago by Nick Palladinos
Units of Measure
Show's how to define units of measure to add stronger typing to your numerical functions.
52 people like this
Posted: 1 years ago by Robert PickeringPipeline list processing
An example showing how to process list in a pipeline. We first use List.filter to return only even numbers and then use List.map to format them as strings.
68 people like this
Posted: 1 years ago by Tomas PetricekLoad XAML
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.
54 people like this
Posted: 1 years ago by Antonio Cisternino
Snippets by tags
View all..Snippets by authors
View all..Database contains 647 snippets out of which 512 are public.