| 1 |
------------------------------------------------------------------------ |
| 2 |
-- The Agda standard library |
| 3 |
-- |
| 4 |
-- Empty type, judgementally proof irrelevant, Level-monomorphic |
| 5 |
------------------------------------------------------------------------ |
| 6 |
|
| 7 |
{-# OPTIONS --cubical-compatible --safe #-} |
| 8 |
|
| 9 |
module Data.Empty where |
| 10 |
|
| 11 |
open import Data.Irrelevant using (Irrelevant) |
| 12 |
|
| 13 |
------------------------------------------------------------------------ |
| 14 |
-- Definition |
| 15 |
|
| 16 |
-- Note that by default the empty type is not universe polymorphic as it |
| 17 |
-- often results in unsolved metas. See `Data.Empty.Polymorphic` for a |
| 18 |
-- universe polymorphic variant. |
| 19 |
|
| 20 |
private |
| 21 |
data Empty : Set where |
| 22 |
|
| 23 |
-- ⊥ is defined via Data.Irrelevant (a record with a single irrelevant |
| 24 |
-- field) so that Agda can judgementally declare that all proofs of ⊥ |
| 25 |
-- are equal to each other. In particular this means that all functions |
| 26 |
-- returning a proof of ⊥ are equal. |
| 27 |
|
| 28 |
⊥ : Set |
| 29 |
⊥ = Irrelevant Empty |
| 30 |
|
| 31 |
{-# DISPLAY Irrelevant Empty = ⊥ #-} |
| 32 |
|
| 33 |
------------------------------------------------------------------------ |
| 34 |
-- Functions |
| 35 |
|
| 36 |
⊥-elim : ∀ {w} {Whatever : Set w} → ⊥ → Whatever |
| 37 |
⊥-elim () |
| 38 |
|
| 39 |
⊥-elim-irr : ∀ {w} {Whatever : Set w} → .⊥ → Whatever |
| 40 |
⊥-elim-irr () |