TP

Quotations Visualizer for F# 1.1.13.8

Quotation Visualizer is my tool that shows visual representation of F# quotations. Stephen noticed (Thanks!) that Quotation Visualizer doesn't compile with the latest version of F# (1.1.13.8), so here is the updated version:

What was wrong?

This tool is written using F# light syntax, which means that you don't have to write all the semicolons and F# compiler uses whitespace to determine end of the blocks (and some other constructs). This compiler option is relatively new so it is still evolving. First issue that I had is with class declaration - the following code is not valid with the latest F# version:

type MyForm = class inherit Form as base
// ...
end


I used it because it looks more familiar to C# developers :-). Instead of it you have to write the following:

type MyForm = class
inherit Form as base
// ...
end


The second issue was with the pipeline operator which is useful when working with lists (or other sequences). The correct syntax for using pipeline operator (for expressions that are longer than one line) is following:

let filteredList =
oldArray
|> Array.to_list
|> List.map ( fun m -> /* ... */ )
|> List.filter ( fun m -> /* ... */ )


Published: Wednesday, 14 February 2007, 11:35 PM
Author: Tomas Petricek
Typos: Send me a pull request!
Tags: f#