Recent snippets

Popular snippets

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

    84 people like this

    Posted: 15 years ago by Dmitri Pavlenkov

  • Wicked way to solve quadratic equation using list of operators

    This is to demonstrate that: (1) there are many ways to solve the same problems; (2) operators can be grouped together into data structures and act as data; (3) you can have fun in F# in many ways.

    57 people like this

    Posted: 15 years ago by Dmitry Soshnikov

  • 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

wpf (20) math (35) computation builder (17) monad (24) algorithms (25) design patterns (18) reflection (19) fold (22) f# (43) html (16) staging (18) computation expression (15) dsl (23) tutorial (17) array (22) quotations (21) regex (17) lazy (20) parsing (28) pattern matching (15)

View all...

Database contains 3208 snippets out of which 1719 is public.