1234567891011121314151617181920212223242526272829303132333435{-# OPTIONS --safe #-} module Class.HasOrder.Instance where open import Class.DecEqopen import Class.Decidableopen import Class.HasOrder.Coreopen import Data.Integer using (ℤ)open import Data.Nat using (ℕ)open import Data.Rational using (ℚ)open import Data.Sumopen import Functionopen import Relation.Nullary instance import Data.Nat.Properties as Nat hiding (_≟_) ℕ-hasPreorder = HasPreorder ∋ record {Nat; ≤⇔<∨≈ = let open Nat in mk⇔ (λ a≤b → case _ ≟ _ of λ where (yes p) → inj₂ p ; (no ¬p) → inj₁ (≤∧≢⇒< a≤b ¬p)) [ <⇒≤ , ≤-reflexive ] } ℕ-hasPartialOrder = HasPartialOrder ∋ record { ≤-antisym = Nat.≤-antisym } ℕ-hasDecPartialOrder = HasDecPartialOrder {A = ℕ} ∋ record {} import Data.Integer.Properties as Int hiding (_≟_) ℤ-hasPreorder = HasPreorder ∋ record {Int; ≤⇔<∨≈ = let open Int in mk⇔ (λ a≤b → case _ ≟ _ of λ where (yes p) → inj₂ p ; (no ¬p) → inj₁ (≤∧≢⇒< a≤b ¬p)) [ <⇒≤ , ≤-reflexive ] } ℤ-hasPartialOrder = HasPartialOrder ∋ record { ≤-antisym = Int.≤-antisym } ℤ-hasDecPartialOrder = HasDecPartialOrder {A = ℤ} ∋ record {} import Data.Rational.Properties as Rat hiding (_≟_) ℚ-hasPreorder = hasPreorderFromNonStrict Rat.≤-isPreorder _≟_ ℚ-hasPartialOrder = HasPartialOrder ∋ record { ≤-antisym = Rat.≤-antisym } ℚ-hasDecPartialOrder = HasDecPartialOrder {A = ℚ} ∋ record {}