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".]

    87 people like this

    Posted: 15 years ago by Novox

  • Units of Measure

    Show's how to define units of measure to add stronger typing to your numerical functions.

    75 people like this

    Posted: 15 years ago by Robert Pickering

  • Split a list

    Three ways to split a list in half (but not necessarily in the middle). A forth version added that's very short and should be fast, as we only use List.fold. New champ found.

    83 people like this

    Posted: 14 years ago by Dmitri Pavlenkov

  • Struct Tuple

    Two/Three/Four-element generic tuples implemented as a value types for writing more efficient F# code.

    77 people like this

    Posted: 14 years ago by fholm

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

    73 people like this

    Posted: 14 years ago by Dmitri Pavlenkov

  • get the list of LAN Sql servers

    get the list of ethernet sql servers

    90 people like this

    Posted: 14 years ago by nCdy

Snippets by tags

http (18) math (35) agent (20) staging (18) reflection (19) string (29) recursion (33) async (98) generic programming (17) tryfsharp (48) parsing (28) kata (17) computation expression (15) regex (17) design patterns (18) pattern matching (15) quotations (21) game (32) sequences (48) sequence (32)

View all...

Database contains 3207 snippets out of which 1719 is public.