Recent snippets

Popular snippets

  • Adapter pattern

    Invoke the methods from incompatible types

    110 people like this

    Posted: 14 years ago by Tao Liu

  • Partition a sequence until a predicate is satiated

    This function is given a partition predicate and a sequence. Until the predicate returns false, a list will be filled with elements. When it is, both the list and the remainder of the sequence will be returned. Note that this example preserves the laziness of the unchecked sequence elements.

    74 people like this

    Posted: 15 years ago by Rick Minerich

  • 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

Snippets by tags

web (29) sequence (32) fold (22) silverlight (22) regex (17) f# (43) string (29) generic programming (17) parsing (28) agent (20) async (98) design patterns (18) collections (16) list (56) pattern matching (15) lists (15) learning f# (16) lazy (20) sequences (48) kata (17)

View all...

Database contains 3208 snippets out of which 1719 is public.