Skip to content

Instantly share code, notes, and snippets.

View pirrmann's full-sized avatar

Pierre Irrmann pirrmann

View GitHub Profile
@pirrmann
pirrmann / Nat.fs
Last active December 25, 2015 21:59 — forked from akimboyko/Nat.fs
An implementation of basic non-negative integers, based on https://gist.github.com/akimboyko/7019648, but rewritten in a more F# idiomatic way
//An implementation of basic non-negative integers, based on https://gist.github.com/akimboyko/7019648,
//but rewritten in a more F# idiomatic way
module Naturals
open System
type Natural =
| Zero
| Succ of Natural
member x.IsZero' = x = Zero