Recent snippets

Popular snippets

  • Creating objects with events

    This snippet shows how to create objects with events in F#. It shows both simple event (to be used from F#) and a .NET compatible event with specific delegate type.

    75 people like this

    Posted: 5 years ago by Tomas Petricek

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

    75 people like this

    Posted: 4 years ago by Tao Liu

  • Composing a list of functions

    Composition of functions in F# is easily achieved by using the >> operator. You can also chain an arbitary amount of functions (represented as a list or sequence) together by folding the list/seq with >>. [More formally: the set of endomorphisms 'a -> 'a forms a monoid with the binary, associative operator ">>" (or "<<") and the neutral element "id".]

    77 people like this

    Posted: 5 years ago by Novox

Snippets by tags

math (28) fold (16) computation builder (13) F# (36) sequences (23) quotations (13) sequence (19) tryfsharp (48) monad (14) Design Patterns (18) MailboxProcessor (15) WPF (15) array (14) seq (32) Sequence (10) Kata (12) parsing (17) lists (10) reflection (14) dsl (13)

View all...

Database contains 1903 snippets out of which 1364 is public.