Recent snippets

Popular snippets

  • Read only ref

    F# implementation of RO_ref from the "Effective ML" talk.

    93 people like this

    Posted: 15 years ago by fholm

  • 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

  • NUnit Sugar

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

    91 people like this

    Posted: 15 years ago by Ryan Riley

  • Projecting lists

    Three functions showing how to implement projection for functional lists. First version uses naive recursion and the second one is tail-recursive using the accumulator parameter. The third version extends this with continuation passing.

    75 people like this

    Posted: 15 years ago by Tomas Petricek

  • NUnit Sugar

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

    91 people like this

    Posted: 15 years ago by Ryan Riley

  • 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: 15 years ago by Dmitri Pavlenkov

Snippets by tags

agent (20) dsl (23) math (35) seq (54) reflection (19) f# (43) list (56) sequences (48) computation expression (15) sequence (32) array (22) tryfsharp (48) tutorial (17) kata (17) json (16) async (98) mailboxprocessor (27) collections (16) string (29) quotations (21)

View all...

Database contains 3208 snippets out of which 1719 is public.