Skip to content

Commit

Permalink
Tidy up: s/Set/Type + flags + levels
Browse files Browse the repository at this point in the history
  • Loading branch information
omelkonian committed Nov 26, 2024
1 parent 2d7cb5c commit 4c5e885
Show file tree
Hide file tree
Showing 43 changed files with 84 additions and 105 deletions.
2 changes: 1 addition & 1 deletion Class/Applicative.agda
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{-# OPTIONS --without-K #-}
{-# OPTIONS --cubical-compatible #-}
module Class.Applicative where

open import Class.Applicative.Core public
Expand Down
2 changes: 1 addition & 1 deletion Class/Applicative/Core.agda
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{-# OPTIONS --without-K #-}
{-# OPTIONS --cubical-compatible #-}
module Class.Applicative.Core where

open import Class.Prelude
Expand Down
2 changes: 1 addition & 1 deletion Class/Applicative/Instances.agda
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{-# OPTIONS --without-K #-}
{-# OPTIONS --cubical-compatible #-}
module Class.Applicative.Instances where

open import Class.Prelude
Expand Down
2 changes: 1 addition & 1 deletion Class/Bifunctor.agda
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{-# OPTIONS --without-K #-}
{-# OPTIONS --cubical-compatible #-}
module Class.Bifunctor where

open import Class.Prelude hiding (A; B; C)
Expand Down
3 changes: 1 addition & 2 deletions Class/CommutativeMonoid.agda
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{-# OPTIONS --safe --without-K #-}

{-# OPTIONS --cubical-compatible #-}
module Class.CommutativeMonoid where

open import Class.CommutativeMonoid.Core public
Expand Down
9 changes: 5 additions & 4 deletions Class/CommutativeMonoid/Core.agda
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{-# OPTIONS --safe --without-K #-}

{-# OPTIONS --cubical-compatible #-}
module Class.CommutativeMonoid.Core where

import Algebra as Alg
open import Class.Prelude
open import Class.Semigroup
open import Class.Monoid

import Algebra as Alg

record CommutativeMonoid c ℓ Carrier : Type (lsuc (c ⊔ ℓ)) where
infix 4 _≈_
field
Expand All @@ -19,7 +19,8 @@ module Conversion {c ℓ} where
toBundle : {Carrier} CommutativeMonoid c ℓ Carrier Alg.CommutativeMonoid c ℓ
toBundle c = record { CommutativeMonoid c }

fromBundle : (m : Alg.CommutativeMonoid c ℓ) CommutativeMonoid c ℓ (Alg.CommutativeMonoid.Carrier m)
fromBundle : (m : Alg.CommutativeMonoid c ℓ)
CommutativeMonoid c ℓ (Alg.CommutativeMonoid.Carrier m)
fromBundle c = record
{ Alg.CommutativeMonoid c using (_≈_; isCommutativeMonoid)
; semigroup = λ where ._◇_ Alg.CommutativeMonoid._∙_ c
Expand Down
2 changes: 1 addition & 1 deletion Class/CommutativeMonoid/Instances.agda
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{-# OPTIONS --safe --without-K #-}
{-# OPTIONS --cubical-compatible #-}

module Class.CommutativeMonoid.Instances where

Expand Down
2 changes: 1 addition & 1 deletion Class/Core.agda
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{-# OPTIONS --without-K #-}
{-# OPTIONS --cubical-compatible #-}
module Class.Core where

open import Class.Prelude
Expand Down
2 changes: 1 addition & 1 deletion Class/Default.agda
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
-- Types with a default value.
------------------------------------------------------------------------

{-# OPTIONS --without-K #-}
{-# OPTIONS --cubical-compatible #-}
module Class.Default where

open import Class.Prelude
Expand Down
2 changes: 1 addition & 1 deletion Class/Foldable.agda
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{-# OPTIONS --without-K #-}
{-# OPTIONS --cubical-compatible #-}
module Class.Foldable where

open import Class.Foldable.Core public
Expand Down
2 changes: 1 addition & 1 deletion Class/Foldable/Core.agda
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{-# OPTIONS --without-K #-}
{-# OPTIONS --cubical-compatible #-}
module Class.Foldable.Core where

open import Class.Prelude
Expand Down
2 changes: 1 addition & 1 deletion Class/Foldable/Instances.agda
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{-# OPTIONS --without-K #-}
{-# OPTIONS --cubical-compatible #-}
module Class.Foldable.Instances where

open import Class.Prelude
Expand Down
2 changes: 1 addition & 1 deletion Class/Functor.agda
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{-# OPTIONS --without-K #-}
{-# OPTIONS --cubical-compatible #-}
module Class.Functor where

open import Class.Functor.Core public
Expand Down
2 changes: 1 addition & 1 deletion Class/Functor/Core.agda
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{-# OPTIONS --without-K #-}
{-# OPTIONS --cubical-compatible #-}
module Class.Functor.Core where

open import Class.Prelude
Expand Down
2 changes: 1 addition & 1 deletion Class/Functor/Instances.agda
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{-# OPTIONS --without-K #-}
{-# OPTIONS --cubical-compatible #-}
module Class.Functor.Instances where

open import Class.Prelude
Expand Down
2 changes: 1 addition & 1 deletion Class/HasAdd.agda
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{-# OPTIONS --safe --cubical-compatible #-}
{-# OPTIONS --cubical-compatible #-}
module Class.HasAdd where

open import Class.HasAdd.Core public
Expand Down
8 changes: 5 additions & 3 deletions Class/HasAdd/Core.agda
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
{-# OPTIONS --safe --cubical-compatible #-}
{-# OPTIONS --cubical-compatible #-}
module Class.HasAdd.Core where

record HasAdd (A : Set) : Set where
open import Class.Prelude

record HasAdd (A : Type ℓ) : Type ℓ where
infixl 6 _+_
field _+_ : A A A

open HasAdd ... public
open HasAdd ⦃...⦄ public
2 changes: 1 addition & 1 deletion Class/HasAdd/Instance.agda
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{-# OPTIONS --safe --cubical-compatible #-}
{-# OPTIONS --cubical-compatible #-}
module Class.HasAdd.Instance where

open import Class.HasAdd.Core
Expand Down
2 changes: 0 additions & 2 deletions Class/HasOrder.agda
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
{-# OPTIONS --safe #-}

module Class.HasOrder where

open import Class.HasOrder.Core public
Expand Down
53 changes: 25 additions & 28 deletions Class/HasOrder/Core.agda
Original file line number Diff line number Diff line change
@@ -1,30 +1,28 @@
{-# OPTIONS --safe #-}

{-# OPTIONS --without-K #-}
module Class.HasOrder.Core where

open import Class.Prelude
open import Class.Decidable
open import Data.Empty
open import Data.Product
open import Data.Sum
open import Function
open import Level
open import Relation.Binary
open import Relation.Binary using () renaming (Decidable to Decidable²)
open import Relation.Binary.PropositionalEquality
open import Relation.Nullary
open import Function.Bundles using (module Equivalence; mk⇔; _⇔_)
open import Relation.Binary using
( IsPreorder; IsPartialOrder; IsEquivalence; Total; IsTotalOrder
; IsStrictTotalOrder; IsStrictPartialOrder
; Irreflexive; Antisymmetric; Asymmetric; Transitive
)

open Equivalence

module _ {a} {A : Set a} where
module _ {_≈_ : Rel A a} where
module _ {A : Type ℓ} where
module _ {_≈_ : Rel A ℓ′} {ℓ″ ℓ‴} (let 𝐿 = lsuc ℓ ⊔ ℓ′ ⊔ lsuc ℓ″ ⊔ lsuc ℓ‴) where

record HasPreorder : Set (suc a) where
record HasPreorder : Type 𝐿 where
infix 4 _≤_ _<_ _≥_ _>_
field
_≤_ _<_ : Rel A a
_≤_ : Rel A ℓ″
_<_ : Rel A ℓ‴
≤-isPreorder : IsPreorder _≈_ _≤_
<-irrefl : Irreflexive _≈_ _<_
≤⇔<∨≈ : {x y} x ≤ y ⇔ (x < y ⊎ x ≈ y)
≤⇔<∨≈ : {x y : A} x ≤ y ⇔ (x < y ⊎ x ≈ y)

_≥_ = flip _≤_
_>_ = flip _<_
Expand All @@ -33,10 +31,10 @@ module _ {a} {A : Set a} where
using ()
renaming (isEquivalence to ≈-isEquivalence; refl to ≤-refl; trans to ≤-trans)

_≤?_ : ⦃ _≤_ ⁇² ⦄ Decidable _≤_
_≤?_ : ⦃ _≤_ ⁇² ⦄ Decidable² _≤_
_≤?_ = dec²

_<?_ : ⦃ _<_ ⁇² ⦄ Decidable _<_
_<?_ : ⦃ _<_ ⁇² ⦄ Decidable² _<_
_<?_ = dec²

infix 4 _<?_ _≤?_
Expand All @@ -55,12 +53,12 @@ module _ {a} {A : Set a} where

open HasPreorder ⦃...⦄

record HasDecPreorder : Set (suc a) where
record HasDecPreorder : Type 𝐿 where
field ⦃ hasPreorder ⦄ : HasPreorder
⦃ dec-≤ ⦄ : _≤_ ⁇²
⦃ dec-< ⦄ : _<_ ⁇²

record HasPartialOrder : Set (suc a) where
record HasPartialOrder : Type 𝐿 where
field
⦃ hasPreorder ⦄ : HasPreorder
≤-antisym : Antisymmetric _≈_ _≤_
Expand Down Expand Up @@ -90,13 +88,13 @@ module _ {a} {A : Set a} where

open HasPartialOrder ⦃...⦄

record HasDecPartialOrder : Set (suc a) where
record HasDecPartialOrder : Type 𝐿 where
field
⦃ hasPartialOrder ⦄ : HasPartialOrder
⦃ dec-≤ ⦄ : _≤_ ⁇²
⦃ dec-< ⦄ : _<_ ⁇²

record HasTotalOrder : Set (suc a) where
record HasTotalOrder : Type 𝐿 where
field
⦃ hasPartialOrder ⦄ : HasPartialOrder
≤-total : Total _≤_
Expand All @@ -106,15 +104,15 @@ module _ {a} {A : Set a} where

open IsEquivalence ≈-isEquivalence renaming (sym to ≈-sym)

≮⇒≥ : Decidable _≈_ {x y} ¬ (x < y) y ≤ x
≮⇒≥ : Decidable² _≈_ {x y} ¬ (x < y) y ≤ x
≮⇒≥ _≈?_ {x} {y} x≮y with x ≈? y | ≤-total y x
... | yes x≈y | _ = IsPreorder.reflexive ≤-isPreorder (≈-sym x≈y)
... | _ | inj₁ y≤x = y≤x
... | no x≉y | inj₂ x≤y = contradiction (≤∧≉⇒< (x≤y , x≉y)) x≮y

open HasTotalOrder ⦃...⦄

record HasDecTotalOrder : Set (suc a) where
record HasDecTotalOrder : Type 𝐿 where
field
⦃ hasTotalOrder ⦄ : HasTotalOrder
⦃ dec-≤ ⦄ : _≤_ ⁇²
Expand All @@ -133,9 +131,9 @@ open HasDecPartialOrder ⦃...⦄ public hiding (hasPartialOrder)
open HasTotalOrder ⦃...⦄ public hiding (hasPartialOrder)
open HasDecTotalOrder ⦃...⦄ public hiding (hasTotalOrder)

module _ {a} {A : Set a} {_≈_ : Rel A a} where
module _ {A : Type ℓ} {_≈_ : Rel A ℓ′} where

module _ {_≤_ : Rel A a} where
module _ {_≤_ : Rel A ℓ″} where
import Relation.Binary.Construct.NonStrictToStrict _≈_ _≤_ as SNS

module _ (≤-isPreorder : IsPreorder _≈_ _≤_)
Expand All @@ -158,7 +156,7 @@ module _ {a} {A : Set a} {_≈_ : Rel A a} where
; ≤-antisym = antsym
}

module _ {_<_ : Rel A a} where
module _ {_<_ : Rel A ℓ″} where

import Relation.Binary.Construct.StrictToNonStrict _≈_ _<_ as SNS

Expand All @@ -181,7 +179,6 @@ module _ {a} {A : Set a} {_≈_ : Rel A a} where
; ≤-antisym = SNS.isPartialOrder <-isStrictPartialOrder .IsPartialOrder.antisym
}


module _ (<-isStrictTotalOrder : IsStrictTotalOrder _≈_ _<_) where

private spo = IsStrictTotalOrder.isStrictPartialOrder <-isStrictTotalOrder
Expand Down
3 changes: 1 addition & 2 deletions Class/HasOrder/Instance.agda
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{-# OPTIONS --safe #-}

{-# OPTIONS --without-K #-}
module Class.HasOrder.Instance where

open import Class.DecEq
Expand Down
2 changes: 1 addition & 1 deletion Class/Monad.agda
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{-# OPTIONS --without-K #-}
{-# OPTIONS --cubical-compatible #-}
module Class.Monad where

open import Class.Monad.Core public
Expand Down
2 changes: 1 addition & 1 deletion Class/Monad/Core.agda
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{-# OPTIONS --without-K #-}
{-# OPTIONS --cubical-compatible #-}
module Class.Monad.Core where

open import Class.Prelude
Expand Down
2 changes: 1 addition & 1 deletion Class/Monad/Instances.agda
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{-# OPTIONS --without-K #-}
{-# OPTIONS --cubical-compatible #-}
module Class.Monad.Instances where

open import Class.Prelude
Expand Down
2 changes: 1 addition & 1 deletion Class/Monoid.agda
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{-# OPTIONS --without-K #-}
{-# OPTIONS --cubical-compatible #-}
module Class.Monoid where

open import Class.Monoid.Core public
Expand Down
2 changes: 1 addition & 1 deletion Class/Monoid/Core.agda
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{-# OPTIONS --without-K #-}
{-# OPTIONS --cubical-compatible #-}
module Class.Monoid.Core where

open import Class.Prelude
Expand Down
2 changes: 1 addition & 1 deletion Class/Monoid/Instances.agda
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{-# OPTIONS --without-K #-}
{-# OPTIONS --cubical-compatible #-}
module Class.Monoid.Instances where

open import Class.Prelude
Expand Down
12 changes: 6 additions & 6 deletions Class/Prelude.agda
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{-# OPTIONS --without-K #-}
{-# OPTIONS --cubical-compatible #-}
module Class.Prelude where

open import Agda.Primitive public
using () renaming (Set to Type; Setω to Typeω)
open import Level public
using (Level; _⊔_) renaming (suc to lsuc)
open import Function public
using (id; _∘_; _∋_; _$_; const; constᵣ; flip; it)
open import Function.Base public
using (id; _∘_; _∋_; _$_; const; constᵣ; flip; it; case_of_)

open import Data.Empty public
using (⊥; ⊥-elim)
Expand Down Expand Up @@ -44,7 +44,7 @@ open import Data.These public
using (These; this; that; these)

open import Relation.Nullary public
using (¬_; Dec; yes; no)
using (¬_; Dec; yes; no; contradiction)
open import Relation.Nullary.Decidable public
using (⌊_⌋; dec-yes; isYes)
open import Relation.Unary public
Expand All @@ -54,7 +54,7 @@ open import Relation.Binary public
using (REL; Rel; DecidableEquality)
renaming (Decidable to Decidable²)
module _ {a b c} where
3REL : (A : Set a) (B : Set b) (C : Set c) (ℓ : Level) Type _
3REL : (A : Type a) (B : Type b) (C : Type c) (ℓ : Level) Type _
3REL A B C ℓ = A B C Type ℓ

Decidable³ : {A B C ℓ} 3REL A B C ℓ Type _
Expand All @@ -66,7 +66,7 @@ open import Reflection public
using (TC; Arg; Abs)

variable
ℓ ℓ′ ℓ″ : Level
ℓ ℓ′ ℓ″ ℓ‴ : Level
A B C : Type ℓ

module Alg (_~_ : Rel A ℓ) where
Expand Down
2 changes: 1 addition & 1 deletion Class/Semigroup.agda
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{-# OPTIONS --without-K #-}
{-# OPTIONS --cubical-compatible #-}
module Class.Semigroup where

open import Class.Semigroup.Core public
Expand Down
2 changes: 1 addition & 1 deletion Class/Semigroup/Core.agda
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{-# OPTIONS --without-K #-}
{-# OPTIONS --cubical-compatible #-}
module Class.Semigroup.Core where

open import Class.Prelude
Expand Down
10 changes: 0 additions & 10 deletions Class/Semigroup/Derive.agda

This file was deleted.

2 changes: 1 addition & 1 deletion Class/Semigroup/Instances.agda
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{-# OPTIONS --without-K #-}
{-# OPTIONS --cubical-compatible #-}
module Class.Semigroup.Instances where

open import Class.Prelude
Expand Down
Loading

0 comments on commit 4c5e885

Please sign in to comment.