A functional wrapper around MailboxProcessor that simplifies agent-based concurrency, adds error handling via events, and provides convenience functions to avoid common pitfalls when working with asynchronous message processing in F#.
0 people like thisPosted: 24 days ago by halcwb
Timestamp: Time format in ISO 8601 with timezone. YYYYMMDDhhmmssffff+zzzz For example 2011-05-17 19:01:10.000 -0200 would be: 20110517190110000-0200
0 people like thisPosted: 2 months ago by Tuomas Hietanen
Word guessing game using ASCII art.
3 people like thisPosted: 3 months ago by Phillip Trelford
Generate random hex-string and calculate base58encode. I made these for some initial BTC-testing, but didn't test too much... seems to work, but would need some unit-tests... :-) Feel free to update or add new versions.
2 people like thisPosted: 4 months ago by Tuomas Hietanen
Click on the tsunami.io button below to launch the online tsunami.io IDE with this snippet. Then select all the code (CTRL+A) and hit the Run button to start the game window, then just dock the window to the right of the code.. Click in the game window to launch missiles and save your cities.
0 people like thisPosted: 4 months ago by Phillip Trelford
An implementation of minimal adaptive cells
0 people like thisPosted: 5 months ago by Onur Gumus
version 1 is http://fssnip.net/62. This new version support convert from any existing function to a converter function by using composition and pipeline. The convert function is to make the function signature agree to the IValueConverter interface. You can add new functions in the FunctionLibrary module and reuse the class definition to reduce the coding effort. The first sample is to show how to make the converter pipeline work, the second one is a debugger converter used to debug the data binding problem.
90 people like thisPosted: 14 years ago by Tao Liu
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.
124 people like thisPosted: 14 years ago by Blake Coverett
Strategy pattern in F#
83 people like thisPosted: 14 years ago by Tao Liu
Learn Key Principle of F# in just a few minutes with the following Sample of "World Bank Type Provider - Exploring Population Data"
383 people like thisPosted: 11 years ago by Muhammad Mugees Asif
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.
84 people like thisPosted: 14 years ago by Tomas Petricek
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".]
87 people like thisPosted: 14 years ago by Novox
reflection (19) computation builder (17) web (29) quotations (21) f# (43) string (29) kata (17) pattern matching (15) agent (20) design patterns (18) monad (24) collections (16) seq (54) array (22) wpf (20) html (16) sequences (48) lists (15) game (32) generic programming (17)
Cesar Mendoza (17) Ankur Dhama (20) NIck Palladinos (14) Phillip Trelford (87) Zhukoff Dima (8) Evgeniy Andreev (13) Rick Minerich (15) Tuomas Hietanen (76) Fabio Galuppo (14) Ryan Riley (25) Joel Huang (13) Samuel Bosch (12) Carsten König (10) mavnn (17) Tao Liu (17) Vesa Karvonen (8) Nick Palladinos (66) Brian Berns (9) Tomas Petricek (150) Eirik Tsarpalis (89)
Database contains 3201 snippets out of which 1715 is public.