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

  • Continuation-Passing Mnemonics

    Continuations provide a means whereby heap space can be traded for stack depth (heap space being generally more plentiful than stack depth). They are especially useful where tail recursion is not possible. Here are a couple of simple continuation examples that can be extended to cover more complex scenarios.

    100 people like this

    Posted: 15 years ago by Neil Carrier

  • Command pattern for Redo-Undo II

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

    71 people like this

    Posted: 15 years ago by Tao Liu

Snippets by tags

reflection (19) computation builder (17) algorithms (25) html (16) lazy (20) fold (22) computation expression (15) game (32) f# (43) lists (15) array (22) async (98) json (16) dsl (23) tutorial (17) math (35) sequence (32) string (29) parsing (28) agent (20)

View all...

Database contains 3212 snippets out of which 1719 is public.