Recent snippets

Popular snippets

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

    67 people like this

    Posted: 5 years ago by Rick Minerich

  • Command pattern for Redo-Undo II

    This command redo-undo implement group the command under Do/Undo category.

    60 people like this

    Posted: 5 years ago by Tao Liu

  • 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: 5 years ago by Alex Muscar

Snippets by tags

web (23) learning f# (16) tryfsharp (48) string (17) recursion (26) option (12) sequences (45) async (89) xml (12) fold (19) kata (17) parsing (22) design patterns (18) wpf (17) http (14) fparsec (12) monad (20) array (17) collections (16) algorithms (25)

View all...

Database contains 1973 snippets out of which 1402 is public.