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

  • Top-Down-Operator-Precedence Parser

    F# implementation of a generic Top-Down-Operator-Precedence Parser as described in this paper http://portal.acm.org/citation.cfm?id=512931 Example starts at line ~300

    90 people like this

    Posted: 15 years ago by fholm

  • Chain of responsibility

    The following sample wants to make sure the person’s age is between 18 and 65, weight is no more than 200 and tall enough (>120).

    85 people like this

    Posted: 15 years ago by Tao Liu

Snippets by tags

lazy (20) pattern matching (15) tryfsharp (48) array (22) tutorial (17) parsing (28) game (32) generic programming (17) learning f# (16) monad (24) seq (54) async (98) fold (22) sequence (32) http (18) dsl (23) staging (18) web (29) collections (16) html (16)

View all...

Database contains 3212 snippets out of which 1719 is public.