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

  • The Haskell const function

    The const function is simple, but you can use it to make your code more legible. In this example we convert a unary function to a function of arity 2 (that ignores the second argument). Also by using the flip function from Haskell (which is equally easy to define) you can ignore the first argument.

    119 people like this

    Posted: 15 years ago by Alex Muscar

  • 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) quotations (21) tryfsharp (48) http (18) seq (54) sequences (48) string (29) silverlight (22) array (22) tutorial (17) parsing (28) recursion (33) computation builder (17) pattern matching (15) html (16) collections (16) json (16) mailboxprocessor (27) fold (22) sequence (32)

View all...

Database contains 3212 snippets out of which 1719 is public.