Recent snippets

Popular snippets

  • Active pattern for let binding inside patterns

    The Let active pattern demonstrated by this snippet can be used to assign values to symbols in pattern matching. This is useful for writing complex pattern matching using match as we can handle multiple cases using a single clause.

    64 people like this

    Posted: 15 years ago by Tomas Petricek

  • 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

  • Factory Pattern

    Factory pattern in F#

    81 people like this

    Posted: 14 years ago by Tao Liu

Snippets by tags

mailboxprocessor (27) design patterns (18) fold (22) f# (43) regex (17) sequence (32) quotations (21) lists (15) generic programming (17) monad (24) parsing (28) reflection (19) game (32) recursion (33) algorithms (25) tryfsharp (48) sequences (48) http (18) async (98) lazy (20)

View all...

Database contains 3208 snippets out of which 1719 is public.