LinkedList functional extension providing find and findi higher order functions that take a predicate function.
41 people like thisPosted: 13 years ago by Phillip Trelford
The ObservableObject type implements the INotifyPropertyChanged interface used in WPF and Silverlight to notify on changes to properties that are bound to a control. Specify property names type safely using F# Quotations, i.e. <@ this.PropertyName @> when invoking the NotifyPropertyChanged method. If you are following the MVVM pattern then your View Model class can inherit from the ObservableObject type.
67 people like thisPosted: 13 years ago by Phillip Trelford
Spreadsheet script runnable inside http://tryfsharp.org includes a custom DataGrid and a parser for simple formulas e.g.: =1+1 =SUM(A1,A2) Add your own functions to the evaluate function. For a more comprehensive implementation check out http://cellz.codeplex.com
6 people like thisPosted: 13 years ago by Phillip Trelford
Simple Silverlight Calculator UI interactive sample runnable inside http://tryfsharp.org.
1 people like thisPosted: 13 years ago by Phillip Trelford
State machine example, from Martin Fowler's Domain-Specific Languages book, implemented as an External DSL parser in F#. A set of mutually recursive functions are used to parse the string tokens and build the State Machine as an F# record type.
12 people like thisPosted: 13 years ago by Phillip Trelford
Playable Tetris mini-game. Use arrow keys to move left and right and up to rotate, down to drop. Try it out in the browser on TryFSharp.org
18 people like thisPosted: 13 years ago by Phillip Trelford
Turtle graphics library implemented as an internal DSL, providing a very similar syntax to Logo, it is runnable inside TryFSharp.org.
10 people like thisPosted: 13 years ago by Phillip Trelford
JSON Parser using Regular Expressions & Active Patterns (just for fun).
8 people like thisPosted: 13 years ago by Phillip Trelford
Simple times table browser based game., compiles to JavaScript via Pit (v0.1) (http://pitfw.posterous.com). Run: http://trelford.com/SevenSixes.htm
2 people like thisPosted: 13 years ago by Phillip Trelford
Simple DSL for describing cups of Starbucks coffee and computing prices (in dollars).
16 people like thisPosted: 12 years ago by Phillip Trelford
10 line Point of Sale (POS) application takes barcodes from a USB barcode scanner or keyboard adding matching products. Entering an empty string completes the action and gives the total.
7 people like thisPosted: 12 years ago by Phillip Trelford
Positions child elements in sequential position from left to right, breaking content to the next line at the edge of the containing box. Tryable at http://tryfsharp.org
3 people like thisPosted: 12 years ago by Phillip Trelford
Solution to Minesweeper Kata challenge at Goto Copenhagen 2012 conference "Programming with the Stars" track.
4 people like thisPosted: 12 years ago by Phillip Trelford
Minesweeper computation Kata as a tweet (140 characters) not counting code to open namespace and to prepare field as a 2D array.
6 people like thisPosted: 12 years ago by Phillip Trelford
Minimal Befunge-93 interpreter.
2 people like thisPosted: 12 years ago by Phillip Trelford
Conway's Game of Life example at F#unctional Londoners July 2012 meetup.
2 people like thisPosted: 12 years ago by Phillip Trelford
Readonly generic Hashtable class implementation example.
4 people like thisPosted: 12 years ago by Phillip Trelford
References and type definition to open StackOverflow API over OData
6 people like thisPosted: 12 years ago by Phillip Trelford
Reversi Kata solution from February 2013 London F# Meetup Coding Kata.
5 people like thisPosted: 11 years ago by Phillip Trelford
Estimate the value of PI using a Monte Carlo simulation.
5 people like thisPosted: 11 years ago by Phillip Trelford
Generates a WAVE sound file
10 people like thisPosted: 11 years ago by Phillip Trelford
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.
3 people like thisPosted: 11 years ago by Phillip Trelford
Blow up words to ASCII art with this 5x5 font
7 people like thisPosted: 11 years ago by Phillip Trelford
xBehave QuickStart sample direct conversion to F# from C#: https://github.com/xbehave/xbehave.net/wiki/Quickstart
1 people like thisPosted: 11 years ago by Phillip Trelford
xBehave Quickstart sample conversion in F# using a custom operator: https://github.com/xbehave/xbehave.net/wiki/Quickstart https://github.com/xbehave/xbehave.net/wiki/Scenarios-with-examples
1 people like thisPosted: 11 years ago by Phillip Trelford
Small Basic abstract syntax tree, interpreter and embedded DSL. Supports Small Basic's keywords and arithmetic, logical and comparison operators.
11 people like thisPosted: 10 years ago by Phillip Trelford
Word guessing game using ASCII art.
8 people like thisPosted: 10 years ago by Phillip Trelford
Minimal Logo implementation using FParsec with support for procedures.
8 people like thisPosted: 10 years ago by Phillip Trelford
Naive performance comparison of push model libraries: Reactive Extension (Rx), Observable module (built-in to F#) and Nessos Streams. Note: smaller numbers are better
12 people like thisPosted: 10 years ago by Phillip Trelford
Transparent snowflake using polygons and rotational symmetry, based on paper and scissors method.
3 people like thisPosted: 9 years ago by Phillip Trelford
Based on Uncle Bob's State Machine Compiler for Clean Code video series, parser implemented with FParsec, see https://github.com/unclebob/CC_SMC for Uncle Bob's Java implementation.
7 people like thisPosted: 9 years ago by Phillip Trelford
F# Snippet based on Dave Crook's article "Intro to C# and Analyzing Government Data"; http://blogs.msdn.com/b/dave_crooks_dev_blog/archive/2015/04/20/intro-to-c-and-analyzing-government-data.aspx
2 people like thisPosted: 9 years ago by Phillip Trelford
Flappy bird clone script using WPF, click the mouse or hit space to flap, no collision detection.
6 people like thisPosted: 9 years ago by Phillip Trelford
Flappy bird clone script using Mono's Xwt toolkit, click the mouse or hit space to flap, no collision detection. To run you will need to build xwt from source https://github.com/mono/xwt
3 people like thisPosted: 9 years ago by Phillip Trelford
Top Trump petition signatures by constituency & their 2015 election results using F# Data's CSV & JSON providers
4 people like thisPosted: 8 years ago by Phillip Trelford
Slicing arrays without copying using .Net's ArraySegment struct
2 people like thisPosted: 8 years ago by Phillip Trelford
Extension methods to List<'T> (aliased ResizeArray<'T> in F#) that provide optimised item removal for unordered lists where item order is not significant.
5 people like thisPosted: 8 years ago by Phillip Trelford
FParsec parser and Windows Forms viewer for minimal Turtle DSL.
3 people like thisPosted: 10 years ago by Phillip Trelford
Finds potential page titles in a HTML page.
1 people like thisPosted: 8 years ago by Phillip Trelford
Turtle interpreter example using Mono's Gtk# library with example paths for MonoDevelop (running on Linux) and Xamarin Studio (running on Mac and Windows).
2 people like thisPosted: 7 years ago by Phillip Trelford
PacMan maze view runnable inside TryFSharp.org
2 people like thisPosted: 4 years ago by Phillip Trelford
Extracts text content from PDF file using PDFsharp.
3 people like thisPosted: 3 years ago by Phillip Trelford
Flappy bird clone script using WinForms, click the mouse or hit space to flap, no collision detection.
6 people like thisPosted: 2 years ago by Phillip Trelford
Pseudoword generator based on code from Evan Fosmark circa 2009.
0 people like thisPosted: 1 month ago by Phillip Trelford
Randomizes order of specified sequence
23 people like thisPosted: 13 years ago by Phillip Trelford
The Subject
Posted: 13 years ago by Phillip Trelford
Simple Silverlight Calculator UI interactive sample runnable inside http://tryfsharp.org.
0 people like thisPosted: 13 years ago by Phillip Trelford
Simple formula calculator including dynamic unit of measure support. Run as a script in Try F#, and try formula with units like 3m * 3m.
0 people like thisPosted: 13 years ago by Phillip Trelford
The ReplaySubject
Posted: 13 years ago by Phillip Trelford
Detects a mouse down then up event without a move.
4 people like thisPosted: 13 years ago by Phillip Trelford
Simple times table console based game.
3 people like thisPosted: 13 years ago by Phillip Trelford
Simple calculator application for adding numbers, compiles to JavaScript via Pit (v0.1) (http://pitfw.posterous.com). Run: http://trelford.com/PitCalculatorApp.htm
3 people like thisPosted: 13 years ago by Phillip Trelford
Minimal Inversion of Control (IoC) Container for Dependency Injection (DI) in under 100 lines of code. Implements the 3 Rs of DI: Register, Resolve, Release. Note: missing thread safety and fluent interface.
13 people like thisPosted: 13 years ago by Phillip Trelford
Shuffles a deck of cards, deals 2 hands applying punto banco rules before declaring a winner or a tie.
4 people like thisPosted: 12 years ago by Phillip Trelford
Pong video game runnable inside TryFSharp.org. Player 1 keys 'Q' - up, 'A' - down. Player 2 keys 'P' - up, 'L' - down.
7 people like thisPosted: 12 years ago by Phillip Trelford
Zombie state machine code sample. Use arrow keys to move humanoid. Robots activate when in range of humanoids. Try it out in the browser with TryFSharp.org.
6 people like thisPosted: 12 years ago by Phillip Trelford
Solution to Minesweeper Kata second challenge at Goto Copenhagen 2012 conference "Programming with the Stars" track. Runnable at http://tryfsharp.org.
2 people like thisPosted: 12 years ago by Phillip Trelford
A minimal Brainfuck Interpreter (<30 lines) running Hello World!
6 people like thisPosted: 12 years ago by Phillip Trelford
Single level retro game playable inside TryFsharp using the cursor keys.
9 people like thisPosted: 12 years ago by Phillip Trelford
Creates all possible mobile phone letter combinations from a number.
2 people like thisPosted: 12 years ago by Phillip Trelford
Quick & dirty solution to Reversi kata: http://codingdojo.org/cgi-bin/wiki.pl?KataReversi
1 people like thisPosted: 12 years ago by Phillip Trelford
F# Mocking library with a fluent interface Moq users should find familiar. Generate mocks for interfaces and abstract types. Supports mocking methods, properties and events. Specify arguments as wildcards or values to match. Define results as values, computed values or exceptions.
6 people like thisPosted: 12 years ago by Phillip Trelford
Evaluates a useful subset of F# quotations at run-time (without the F# PowerPack API).
15 people like thisPosted: 11 years ago by Phillip Trelford
Generates Text art in the style of Philippe Decrauzat's D.T.A.B.T.W.H.A.H.E. 2010 currently exhibited at the MoMA NYC
2 people like thisPosted: 11 years ago by Phillip Trelford
String split function that skips quoted strings, useful as a simple CSV parser
7 people like thisPosted: 11 years ago by Phillip Trelford
WPF version of Missile Command. Run as a script in Visual Studio or create a new application project, reference the assemblies listed at the top of the script and paste the code over Program.fs and hit F5.
8 people like thisPosted: 11 years ago by Phillip Trelford
Purges files in bin and obj folders, useful to reduce size when copying project folders. Be careful, this script will delete files!
1 people like thisPosted: 11 years ago by Phillip Trelford
xBehave QuickStart sample conversion to F# from C# with some helper functions: https://github.com/xbehave/xbehave.net/wiki/Quickstart
1 people like thisPosted: 11 years ago by Phillip Trelford
User Story 1 from the Bank OCR Kata: http://codingdojo.org/cgi-bin/wiki.pl?KataBankOCR
1 people like thisPosted: 11 years ago by Phillip Trelford
A few short usage examples for the FSharp.Date Type Provider (available on Nuget).
3 people like thisPosted: 10 years ago by Phillip Trelford
Test Anything Protocol runner for NUnit lets you run unit tests within an F# interactive session.
3 people like thisPosted: 10 years ago by Phillip Trelford
Type extensions for ASCII strings represented as byte arrays. Note: requires the F# 3.1 compiler.
3 people like thisPosted: 10 years ago by Phillip Trelford
Script to render a Koch snowflake using a Windows Forms bitmap.
4 people like thisPosted: 9 years ago by Phillip Trelford
Based on Uncle Bob's State Machine Compiler for Clean Code video series, parser implemented with FParsec, see https://github.com/unclebob/CC_SMC for the Java implementation.
8 people like thisPosted: 9 years ago by Phillip Trelford
Minimal SNOBOL abstract syntax tree (AST), interpreter and internal DSL (but no parser), just enough to run some simple samples from Wikipedia's SNOBOL page: http://en.wikipedia.org/wiki/SNOBOL and most of the pattern matching examples from the SNOBOL 4 Tutorial http://www.snobol4.org/docs/burks/tutorial/ch4.htm
2 people like thisPosted: 9 years ago by Phillip Trelford
Functional programming operators related to the BCL ImmutableDictionary type.
5 people like thisPosted: 9 years ago by Phillip Trelford
Flappy bird clone script using MonoGame, click the mouse or hit space to flap, no collision detection.
3 people like thisPosted: 9 years ago by Phillip Trelford
Drops 1000 randomly generated pictures in C:\temp. Based on Andrej Bauer's Random Art implementation: http://www.random-art.org/about/
3 people like thisPosted: 9 years ago by Phillip Trelford
Write BMP in ARGB uncompressed 32-bits per-pixel format
3 people like thisPosted: 8 years ago by Phillip Trelford
The Sierpinski carpet is a plane fractal first described by Wacław Sierpiński in 1916.
2 people like thisPosted: 8 years ago by Phillip Trelford
Multi-currency report (generated as HTML) based on example given at the start of chapter one of Kent Beck's Test-Driven Development by Example book.
4 people like thisPosted: 9 years ago by Phillip Trelford
Simple HTTP server, runs on .Net Core, .Net or Mono, and serves GET requests via a handler. The example given serves up static content from a specified directory.
7 people like thisPosted: 8 years ago by Phillip Trelford
Converts the string representation of a number in-place to an Int32. A return value of None indicates the conversion failed.
4 people like thisPosted: 7 years ago by Phillip Trelford
Small Basic abstract syntax tree, parser and interpreter. Supports Small Basic's keywords and arithmetic, logical and comparison operators.
8 people like thisPosted: 6 years ago by Phillip Trelford
Simple prototype C# AST and parser using the FParsec parser combinator library. Parses a subset of C# 1.1 constructs.
8 people like thisPosted: 4 years ago by Phillip Trelford
Procedurally generates a sheet of invader graphics
2 people like thisPosted: 3 years ago by Phillip Trelford
Compiles simple F# quoted expressions (literals, values, operators, ifs and for loops) to Java code.
2 people like thisPosted: 1 year ago by Phillip Trelford