Recent snippets

Popular snippets

  • Break sequence into n-element subsequences

    I'm working on parallel computations and I thought it would be useful to break work into chunks, especially when processing each element asynchronously is too expensive. The neat thing is that this function is general even though motivation for it is specific. Another neat thing is that this is true lazy sequence unlike what you'd get if you used Seq.groupBy. There are three versions for your enjoyment.

    69 people like this

    Posted: 6 years ago by Dmitri Pavlenkov

  • Minimal XML DSL

    This snippet provides a very small internal DSL for creating and querying XML using the underlying XLinq classes.

    357 people like this

    Posted: 6 years ago by Blake Coverett

  • NUnit Sugar

    Some simple functions for writing more idiomatic F# tests with NUnit.

    85 people like this

    Posted: 6 years ago by Ryan Riley

  • NUnit Sugar

    Some simple functions for writing more idiomatic F# tests with NUnit.

    85 people like this

    Posted: 6 years ago by Ryan Riley

  • Dynamic operator using Reflection

    Demonstrates how to implement the dynamic operator (?) using .NET Reflection. The implementation supports calling constructors, propreties and methods using simple overload resolution (based on parameter count). It handles instance as well as static members.

    62 people like this

    Posted: 6 years ago by Tomas Petricek

  • Asynchronous sequences

    An asynchronous sequence is similar to the seq type, but the elements of the sequence are generated asynchronously without blocking the caller as in Async. This snippet declares asynchronous sequence and uses it to compare two files in 1k blocks.

    105 people like this

    Posted: 6 years ago by Tomas Petricek

Snippets by tags

learning f# (16) seq (50) fold (19) sequence (29) string (18) pattern matching (12) async (92) f# (42) tutorial (17) math (32) staging (18) quotations (17) sequences (47) agent (20) lazy (18) collections (16) lists (13) design patterns (18) parsing (22) tryfsharp (48)

View all...

Database contains 2163 snippets out of which 1490 is public.