Skip to content

Instantly share code, notes, and snippets.

View tomphp's full-sized avatar

Tom Oram tomphp

View GitHub Profile
@martinsson
martinsson / fizzbuzz.idr
Last active June 21, 2019 09:58
Dependently typed fizzbuzz with Idris
%default total
-- Proofs that a value is divisible my 3 and 5 respectively
IsFizz : (k : Nat) -> Type
IsFizz k = (modNatNZ k 3 SIsNotZ = 0)
IsBuzz : Nat -> Type
IsBuzz k = (modNatNZ k 5 SIsNotZ = 0)
-- The type Fizzbuzz, one can only construct an instance of Fizz if one can provide