Skip to content

Instantly share code, notes, and snippets.

@Walms
Walms / Fizzer.fs
Created February 27, 2024 21:39
Fizzer
type FizzBuzzer = int -> string
module FizzBuzzer =
type ValidFizzBuzzer = private ValidFizzBuzzer of FizzBuzzer
let createFizzBuzzer (possibleFizzBuzzer: FizzBuzzer) : Result<ValidFizzBuzzer, string> =
if possibleFizzBuzzer 3 = "Fizz" then
Ok (ValidFizzBuzzer possibleFizzBuzzer)
else