Recent snippets

Popular snippets

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

    69 people like this

    Posted: 14 years ago by Rick Minerich

  • Monadic Memoization

    Modular memoization within a pure functional setting that is implemented as a convenient computation builder.

    91 people like this

    Posted: 14 years ago by Nick Palladinos

Snippets by tags

seq (54) list (56) array (22) learning f# (16) recursion (33) wpf (20) computation expression (15) quotations (21) sequence (32) pattern matching (15) f# (43) html (16) silverlight (22) regex (17) algorithms (26) lazy (20) reflection (19) lists (15) math (35) web (29)

View all...

Database contains 3205 snippets out of which 1719 is public.