Recent snippets

  • Migrate from Settings.StyleCop to .ruleset

    https://github.com/DotNetAnalyzers/StyleCopAnalyzers/issues/1099

    1 people like this

    Posted: 11 days ago by journeyman

  • Generic fst and snd functions

    It seems original design for struct tuples doesn't contain struct versions of fst and snd functions. SRTP FTW!

    1 people like this

    Posted: 17 days ago by Evgeniy Andreev

  • tutorial, test, tennis, clarity, simplicity in f#

    f# short and sweet may help beginners. Score on winning a point, Winning number first and other players is labeled: b example "0",b ->"15", b. A special case of draw-deuce is "40", "A" -> "40","40" If player 2 wins a point score calling is flipped as 2->score(b,a). fold (fun to call for each element in the test list) (initials "0","0") [test list of winning player] Notice f# is perhaps easier and clearer than pseudo code and verbose description. An improvement suggestion for Don is if syntax is not confused can word function be made optional so = |... or -> |.. so syntax is ever more clearer?

    6 people like this

    Posted: 18 days ago by Musa Jahanghir

Popular snippets

  • FSX Structure

    I use this basic template when writing .fsx files that I might want to compile. It adjusts the difference in command line/entrypoint handling between a script and a compiled assembly. This example shows the details for a WPF script — replace the #r's and/or remove the STAThread for a WinForms or Console script.

    115 people like this

    Posted: 6 years ago by Blake Coverett

  • Haskell function : iterate

    Implements iterate function from Haskell's Prelude. The function generates an infinite sequence by applying a function to the initial value (first) and then to the result of previous application.

    203 people like this

    Posted: 6 years ago by Nick Palladinos

  • 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: 6 years ago by Tao Liu

Snippets by tags

game (30) sequences (47) staging (18) parsing (22) json (12) string (18) dsl (22) design patterns (18) web (23) mailboxprocessor (25) seq (50) lazy (18) wpf (18) algorithms (25) http (14) collections (16) tryfsharp (48) pattern matching (12) silverlight (21) recursion (26)

View all...

Database contains 2161 snippets out of which 1489 is public.