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

  • Hello world (F#)

    Classical "Hello world" example that prints a message to the console output. This version uses F# printfn function to do the printing.

    186 people like this

    Posted: 15 years ago by Tomas Petricek

  • 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

Snippets by tags

regex (17) computation builder (17) string (29) parsing (28) generic programming (17) learning f# (16) collections (16) http (18) agent (20) algorithms (25) kata (17) math (35) list (56) monad (24) web (29) tutorial (17) lists (15) game (32) dsl (23) sequences (48)

View all...

Database contains 3209 snippets out of which 1719 is public.