module Data.Unit where
open import Data.Sum
open import Relation.Nullary.Core
open import Relation.Binary
open import Relation.Binary.PropositionalEquality
record ⊤ : Set where
tt : ⊤
tt = record {}
record _⊤-≤_ (x y : ⊤) : Set where
data Unit : Set where
unit : Unit
{-# COMPILED_DATA Unit () () #-}
_⊤-≟_ : Decidable {⊤} _≡_
_ ⊤-≟ _ = yes ≡-refl
_⊤-≤?_ : Decidable _⊤-≤_
_ ⊤-≤? _ = yes _
⊤-total : Total _⊤-≤_
⊤-total _ _ = inj₁ _
⊤-preorder : Preorder
⊤-preorder = ≡-preorder ⊤
⊤-setoid : Setoid
⊤-setoid = ≡-setoid ⊤
⊤-decTotalOrder : DecTotalOrder
⊤-decTotalOrder = record
{ carrier = ⊤
; _≈_ = _≡_
; _≤_ = _⊤-≤_
; isDecTotalOrder = record
{ isTotalOrder = record
{ isPartialOrder = record
{ isPreorder = record
{ isEquivalence = ≡-isEquivalence
; reflexive = λ _ → _
; trans = λ _ _ → _
; ≈-resp-∼ = ≡-resp _⊤-≤_
}
; antisym = antisym
}
; total = ⊤-total
}
; _≟_ = _⊤-≟_
; _≤?_ = _⊤-≤?_
}
}
where
antisym : Antisymmetric _≡_ _⊤-≤_
antisym _ _ = ≡-refl
⊤-decSetoid : DecSetoid
⊤-decSetoid = DecTotalOrder.Eq.decSetoid ⊤-decTotalOrder
⊤-poset : Poset
⊤-poset = DecTotalOrder.poset ⊤-decTotalOrder