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.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 = |
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
string myPhrase = "Hell is round the corner where I shelter"; | |
myPhrase = string.Replace(myPhrase, "Hell", "Hevean"); |
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
string myPhrase = "Hell is round the corner where I shelter"; | |
myPhrase = myPhrase.Replace("Hell", "Hevean"); |
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 (|>) x f = f x |
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
class A { | |
static void AMethod(MyBase myBase) { | |
myBase.AMemberMethod(); | |
} | |
} |
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
class A { | |
private List<string> myList = new List<string>(); | |
private List<string> GetCurrentItems(){ | |
return new List<string>(myList); | |
} | |
} |
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
// 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) |
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 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 -> |
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
module ParkingMeterKata | |
open System | |
// coins accepted by the system | |
type Coin = | |
| TenCents = 10 | |
| TwentyCents = 20 | |
| FiftyCents = 50 | |
| OneEuro = 100 | |
| TwoEuro = 200 |
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
[{"Name":"Feck"},{"Name":"Arse"},{"Name":"Arse"}] |