ZachBray/FunScript — pull request #26 by tpetricek (2012-12-17 03:40:07+00:00)
Title: Partial mappings for FSharp.Data and WorldBank sample

This pull request adds the WorldBank sample from my TechMesh talk (yay!)

* I added one more `*.ts` file with mappings for the charting library I used and I also added the launcher in `Examples/Shared` (it runs web server and opens web browser with the result...). The `SimpleAsync` sample is now fixed and also uses the launcher. The WorldBank sample is added and works too :-)

* The data access (WorldBank provider + JSON provider) is done by referencing [normal FSharp.Data](https://github.com/tpetricek/FSharp.Data) normally using NuGet. Then I added a new project `FunJS.Data` that re-implements the necessary functionality in JavaScript (complete for JSON, incomplete for WorldBank). The project exposes additional compiler components that are passed to the compiler in the WorldBank sample project (and they replace JSON calls with JavaScript and the use of WorldBank provider with a simple JS implementation).

* To get this to work, I had to add mapping for TypeScript constructors (which are mapped to `new` method by the TS provider, so `lib.Number.new(42) -> new Number(42)` - this TypeScript feature seems to be a bit odd - because `lib.Number` is really just any value - so this actually becomes `var _i = Number; return new _i(42);`)

I also added one more hack to the `ProvidedTypes.fs` (handling of arrays - in the same style as existing handling of generic types).