Recent snippets

Popular snippets

  • Strategy pattern

    Strategy pattern in F#

    71 people like this

    Posted: 6 years ago by Tao Liu

  • 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

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

    78 people like this

    Posted: 7 years ago by Novox

Snippets by tags

http (15) regex (14) lazy (18) sequences (47) silverlight (21) fparsec (14) seq (51) async (92) tutorial (17) web (24) fold (19) mailboxprocessor (26) staging (18) agent (20) json (12) string (21) dsl (22) xml (12) tryfsharp (48) collections (16)

View all...

Database contains 2233 snippets out of which 1526 is public.