This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let vb6exe = | |
ProgramFilesX86 @@ "Microsoft Visual Studio\\VB98" @@ "VB6.exe" | |
let VB6Build outputPath projects = | |
let build outputPath project = | |
traceStartTask "VB6Build" project | |
let args = sprintf "/make %s /outdir %s" project outputPath | |
tracefn "Building project: %s\n %s %s" project vb6exe args |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let inline (|>) x f = f x | |
let inline (||>) (x1,x2) f = f x1 x2 | |
let inline (|||>) (x1,x2,x3) f = f x1 x2 x3 | |
let inline (<|) f x = f x | |
let inline (<||) f (x1,x2) = f x1 x2 | |
let inline (<|||) f (x1,x2,x3) = f x1 x2 x3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Pipeline in the opposite direction | |
> double <| 10;; | |
val it : int = 20 | |
> subtract 2 <| 4;; | |
val it : int = 2 | |
// Pipeline with a tuple | |
> (2, 4) ||> subtract;; | |
val it : int = 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Some functions to play with | |
let double x = x * 2 | |
let triple x = x * 3 | |
let square x = x * x | |
// fsi | |
>2 |> double;; | |
val it : int 4 | |
let pipelining n = |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
open System.Collections.Generic | |
// A simple function with some built in delay | |
// val square : int -> int | |
let square x = | |
System.Threading.Thread.Sleep(x * 1000) | |
x * x | |
// A generic memoization function that takes a function with one parameter | |
// val memoization : ('a -> 'b) -> ('a -> 'b) when 'a : equality |