Skip to content

Instantly share code, notes, and snippets.

@gelisam
Created January 5, 2025 14:00
Show Gist options
  • Save gelisam/339bddae9a25bc63596524623d4b6169 to your computer and use it in GitHub Desktop.
Save gelisam/339bddae9a25bc63596524623d4b6169 to your computer and use it in GitHub Desktop.
a function can be passed a postulate as an irrelevant argument and still still compute a result
-- a demonstration that a function can be passed a postulate as an irrelevant
-- argument and still still compute a result
module Irrelevance where
open import Data.Nat
open import Relation.Binary.PropositionalEquality
open ≡-Reasoning
postulate
undefined :
data Vec (A : Set) : Set where
nil
: Vec A 0
cons
: {n : ℕ}
A
Vec A n
Vec A (suc n)
length : {A : Set} {n : ℕ} Vec A n
length nil
= 0
length (cons _ xs)
= 1 + length xs
test : length {ℕ} {undefined} (cons 1 (cons 2 nil)) ≡ 2
test = refl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment