Skip to content

Instantly share code, notes, and snippets.

View robertpi's full-sized avatar

Robert Pickering robertpi

View GitHub Profile
open System.IO
open System.Collections.Generic
let rec getSize =
let memorize = new Dictionary<string, int64>()
fun dir ->
if memorize.ContainsKey(dir) then
memorize.[dir]
else
let size =
string myPhrase = "Hell is round the corner where I shelter";
myPhrase = string.Replace(myPhrase, "Hell", "Hevean");
string myPhrase = "Hell is round the corner where I shelter";
myPhrase = myPhrase.Replace("Hell", "Hevean");
let (|>) x f = f x
class A {
static void AMethod(MyBase myBase) {
myBase.AMemberMethod();
}
}
class A {
private List<string> myList = new List<string>();
private List<string> GetCurrentItems(){
return new List<string>(myList);
}
}
// Learn more about F# at http://fsharp.net
let rate = 0.04
let baseSalary = 100000.
let baseYear = 2011
let salaries =
Seq.unfold(fun (year, salary) ->
let nextYear, nextSalary = year + 1, salary * (1.0 + rate)
let walkCommits (hash: Hash, count) =
printfn "%s %s %s" objectsDir hash.DirectoryName hash.FileName
let objectPath = Path.Combine(objectsDir, hash.DirectoryName, hash.FileName)
printfn "objectPath: %s" objectPath
let gitObject = GitObject.ParseFile objectPath
match gitObject with
| Commit (_, commit) ->
match commit.Parent with
| Some (hash) when count < 10 ->
module ParkingMeterKata
open System
// coins accepted by the system
type Coin =
| TenCents = 10
| TwentyCents = 20
| FiftyCents = 50
| OneEuro = 100
| TwoEuro = 200
[{"Name":"Feck"},{"Name":"Arse"},{"Name":"Arse"}]