Recent snippets

Popular snippets

  • Composing a list of functions

    Composition of functions in F# is easily achieved by using the >> operator. You can also chain an arbitary amount of functions (represented as a list or sequence) together by folding the list/seq with >>. [More formally: the set of endomorphisms 'a -> 'a forms a monoid with the binary, associative operator ">>" (or "<<") and the neutral element "id".]

    79 people like this

    Posted: 7 years ago by Novox

  • 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.

    63 people like this

    Posted: 7 years ago by Tomas Petricek

  • 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.

    70 people like this

    Posted: 7 years ago by Dmitri Pavlenkov

Snippets by tags

lazy (18) lists (13) regex (14) staging (18) string (21) recursion (27) sequences (47) tutorial (17) tryfsharp (48) learning f# (16) web (24) design patterns (18) list (49) quotations (18) monad (21) async (94) pattern matching (13) computation builder (14) xml (12) seq (51)

View all...

Database contains 2248 snippets out of which 1536 is public.