module Demo where
data Bool : Set where
true : Bool
false : Bool
data ℕ : Set where
zero : ℕ
succ : ℕ → ℕ
not : Bool → Bool
not true = false
not false = true
_∧_ : Bool → Bool → Bool
false ∧ b = false
true ∧ b = b
_∨_ : Bool → Bool → Bool
true ∨ b = true
false ∨ b = b
cond : forall (a : Set) → Bool → a → a → a
cond a true t e = t
cond a false t e = e
id : forall {a : Set} → a → a
id x = x
id-bool : Bool → Bool
id-bool = id {Bool}
cond-example : ℕ
cond-example = cond _ (true ∧ false) zero (succ zero)
id-example : ℕ
id-example = id zero