Skip to content

Instantly share code, notes, and snippets.

View akhansari's full-sized avatar
🦎

Amin Khansari akhansari

🦎
View GitHub Profile
@akhansari
akhansari / 99BottlesSong.Tests.fs
Last active May 15, 2023 07:48
99 Bottles of FP, Shameless Green
module NinetyNineBottles.SongTests
open Xunit
[<Fact>]
let ``Verse 99`` () =
let expected = "99 bottles of beer on the wall, 99 bottles of beer.
Take one down and pass it around, 98 bottles of beer on the wall."
let verse = Song.One 99 |> Song.verses
Assert.Equal(expected, verse)
using System;
using System.Globalization;
using System.Linq;
using System.Text;
EqualsIgnoreCaseAndDiacritics("héLloṩ", "hellos"); // true
static string RemoveDiacritics(string str) =>
str is null ? null :
string.Concat(str
@akhansari
akhansari / EsBankAccount.ts
Last active April 8, 2024 12:40
TypeScript prototype of the Decider pattern. (F# version: https://github.com/akhansari/EsBankAccount)
import * as assert from "assert";
/** Decider Pattern **/
type Transaction = {
amount: number
date: Date
}
type Deposited = Transaction & {